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