I am creating a new object say ‘motors’ and I define it for the compiler by
//sender is a TPSScript
//functions defined:
procedure Tmotorsgetdepart(Self: motors; var T: integer); begin T := Self.fdepart; end;
procedure Tmotorssetdepart(Self: motors; var T: integer); begin Self.fdepart:=T; end;
with sender.comp.AddClassN(sender.comp.FindClass(‘TOBJECT’), ‘MOTORS’) do
begin
registerproperty(‘dep’,‘INTEGER’,iptRW);
end;
after for runtime
cl:=sender.RuntimeImporter.add(motors);
with cl do
begin
RegisterPropertyHelper(@Tmotorsgetdepart,@Tmotorssetdepart,‘dep’);
end;
sender.SetPointerToData(‘X’, @mot[1], sender.FindNamedType(‘motors’));
If I have in the script
X.dep:=0;
It compiles well but under execution I have the message “could not call proc”
I tried a lot of things without solving the problem. Where is the error?