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_2),
> > (name:'setup_function_3';func:@setup_function_3));
> > 
> > Then search the name of the function you want to call in the table, then
> > call the function in the "func" field.
> Thanks, but the consts should be:
> 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'; func: setup_function_3));
> 
> However compiling with {$mode objfpc} I get the error:
> ** Error: Some fields coming before "name" weren't initialized
> and it dosen't compile.

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.

Daniël
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to