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

Jilani Khaldi jilani at cheapnet.it
Wed Oct 10 15:21:52 CEST 2007


> 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;
     func: SetupFunc;
   end;

const
   SFM: array[0..2] of TSetupFuncMapping = (
   (x: nil; name: 'SetupFunction_1'; func: SetupFunction_1),
   (x: nil; name: 'SetupFunction_2'; func: SetupFunction_2),
   (x: nil; name: 'SetupFunction_3'; func: SetupFunction_3));

Jilani

-- 
Jilani KHALDI




More information about the fpc-pascal mailing list