I have a set of about 256 strings, each of from 1 to 5 characters in length. Each string is associated with a unique procedure. When I isolate one of those strings, surrounded by whitespace, in a "source text," I want to execute the procedure associated with that string.
My general question, for those with more experience in FPC and Lazarus than myself, is how I should best approach this problem. A large "case" statement would do the job of associating a string to its unique procedure, but I suspect that that isn't a very efficient approach.
Are there any classes in the FPC libraries that would be better suited to solving this problem? Something like proven code for doing an efficient tree search on a collection of strings?
(Hope my problem description is clear enough. I've been using case statements to do this, but it seems too spaghetti-like, and I feel like there ought to be a better way.)
Suggestions/pointers appreciated.