[DUG] Run Function called from a database field's data.

Stephen Barker Steve at webdata.co.nz
Fri Mar 5 01:54:16 NZDT 2010


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:marshland at marshland.co.nz] 
Sent: Thursday, 4 March 2010 11:50 p.m.
To: delphi at 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




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20100305/15c00a32/attachment.html 


More information about the Delphi mailing list