Hi Wallace,
 
You could play with RTTI, but as there are only 9 I'd tend to look at a
simple array of function pointers and string function names. Or use a
stringlist (for the names) and store the function pointers in the associated
objects list. At runtime set up the function pointers using the addr()
function.
 
You could get all OO and have a base class with subclasses redefining the
draw method or similar.
 
Steve


  _____  

From: Marshland Engineering [mailto:marshl...@marshland.co.nz] 
Sent: Thursday, 4 March 2010 11:50 p.m.
To: delphi@delphi.org.nz
Subject: [DUG] Run Function called from a database field's data.


I have 9 function routines that are used by several forms.

I have a database with 9 records that has specific data for each function. 

If I select record 4 for example, how do I run a function where it's name is
within the database field called FUNC. 

tbl.Oper.feildbyname['Func'].AsString has 'Circle' or 'Square' as its data 

Now I need to run a function like Circle(Data) or Square(Data) when
selecting the relevant record. 
 
Thanks Wallace

No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.730 / Virus Database: 271.1.1/2721 - Release Date: 03/04/10
08:34:00




_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: delphi@delphi.org.nz
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to delphi-requ...@delphi.org.nz with Subject: 
unsubscribe

Reply via email to