Solved

Lookup Table ?

Posted on 2012-03-21
1
472 Views
Last Modified: 2016-09-29
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
0
Comment
Question by:rotem156
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 45

Accepted Solution

by:
aikimark earned 500 total points
ID: 37753773
@rotem156

>>can i see a sample code

This is new code?  Your question stated that you already have a class with public functions/methods.

There are some code snippets in the comments to a similar question
http://stackoverflow.com/questions/4186458/delphi-call-a-function-whose-name-is-stored-in-a-string
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question