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

2007-10-10 Thread Jilani Khaldi
Did you implement the record exactly as shown? This error normally occurs if you have fields in your record that you don't mention in your typed const declaration. {$mode objfpc} -> Error! {$mode delphi} -> Ok! ... type TSetupFuncMapping = record x: array of double; name:string; f

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

2007-10-10 Thread Daniël Mantione
y Op Wed, 10 Oct 2007, schreef Jilani Khaldi: > > type Tsetupfunc_mapping=record > > name:string; > > func:setupfunc; > > end; > > const setupfunc_mapping:array[0..2] of Tsetupfunc_mapping=( > > (name:'setup_function_1';func:@setup_function_1), > > (name:'setup_function_2';func:@setup_function_

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

2007-10-10 Thread Jilani Khaldi
type Tsetupfunc_mapping=record name:string; func:setupfunc; end; const setupfunc_mapping:array[0..2] of Tsetupfunc_mapping=( (name:'setup_function_1';func:@setup_function_1), (name:'setup_function_2';func:@setup_function_2), (name:'setup_function_3';

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

2007-10-10 Thread Daniël Mantione
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: >

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

2007-10-10 Thread Jilani Khaldi
Hi All, I have this program: program mainfun; {$mode objfpc} uses SysUtils; type SetupFun = function(const vect: array of double): double; MyRec = record x: array of double; myFunName: ShortString; // function name to evoke end; function SetMeUp(const x1: array of double): double; va