Alain a écrit:
Maxbe 'stupid' ... But I'm dealing with it !
---------------------------------------- Type ptrRecord = ^theRecord; Type theRecord = record move : ProcPtr; hit : ProcPtr end;
Procedure moveIt; Begin end;
Procedure hitIt; Begin end;
Procedure Init; Begin object^.move := @moveIt; object^.hit := @hitIt end;
Procedure Run; Begin repeat with object^ do ???? Until ... End; ----------------------------------------
The following progral compiles and runs as you expect ------------------------------------------------------------ program test; type ProcPtr = procedure; Type theRecord = record move : ProcPtr; hit : ProcPtr end; Type ptrRecord = ^theRecord; var obj: ptrRecord; Procedure moveIt; Begin writeln('move') end; Procedure hitIt; Begin writeln('hit') end; Procedure Init; Begin obj^.move := moveIt; obj^.hit := hitIt end; Procedure Run; Begin with obj^ do begin move; hit end End; begin new(obj); init; run; dispose(obj); end. ----------------------------------------------------------- The problem was with unnecessary @ A confusion with C syntax, I suppose Maurice -- Maurice Lombardi Laboratoire de Spectrometrie Physique, Universite Joseph Fourier de Grenoble, BP87 38402 Saint Martin d'Heres Cedex FRANCE Tel: 33 (0)4 76 51 47 51 Fax: 33 (0)4 76 63 54 95 mailto:Maurice.Lombardi@ujf-grenoble.fr