Link to home
Start Free TrialLog in
Avatar of Member_2_5194534
Member_2_5194534

asked on

Lookup Table ?

i have a class that holds some methods...

Server sends Client a function name and Client uses a statement (case/of) to execute it from a hardcoded indexed TStringList.

how can i avoid this ?

someone told me something like this...:

you could use an enumerated type shared across both projects. on the startup of the server, it would index the functions (as procedure objects) in a list, based on the enumerated type

when calling your server's function, just cast the enumerated type as an ordinal, which would change it to integer so it can be transported over socke

that is how to pass a procedure as a pointer
[20/03/2012 23:47:02] Jeff Lefebvre: store a list of procedure pointers, indexed by an enumerated type

1) the link i sent you talks about procedure pointers
2) add procedure pointers into a TList or array, in the same order as the list enumerated type elemented
3) you could do it in a TList, or array of pointers
4) yes, or a TList
ASKER CERTIFIED SOLUTION
Avatar of aikimark
aikimark
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial