[fpc-pascal] Calling a function by name (as string) read from a text file

Daniël Mantione daniel.mantione at freepascal.org
Wed Oct 10 12:36:05 CEST 2007

Op Wed, 10 Oct 2007, schreef Jilani Khaldi:

> {////////////////////////////////////////////////
> Is there a way to "connect" the name of the function as a string "evoke" to
> the true function "evokeFun: SetupFun;" getting a new function
> "newEvokeFun: SetupFun;" so I can write:
> ////////////////////////////////////////////////}

Create a table with function names and the actual function, for example:

type  Tsetupfunc_mapping=record
const setupfunc_mapping:array[0..2] of Tsetupfunc_mapping=(

Then search the name of the function you want to call in the table, then 
call the function in the "func" field.


More information about the fpc-pascal mailing list