Hello, im new to pascal script and delphi. Im trying to pass object from my app to the script but i cant make it. So im asking experienced people to help me.
this is what i have:
function ExtendCompiler(Compiler: TPSPascalCompiler; const Name: AnsiString): Boolean;
var
CustomClass: TPSCompileTimeClass;
begin
try
Compiler.AddDelphiFunction('procedure print(const AText: AnsiString);');
SIRegisterTObject(Compiler); // Add compile-time definition for TObject
CustomClass := Compiler.AddClass(Compiler.FindClass('TObject'), TPerson);
Customclass.RegisterMethod('procedure setAge(AValue: Integer)');
CustomClass.RegisterMethod('function getAge: Integer');
Result := True;
except
Result := False; // will halt compilation
end;
end;
so i can register my object and create it in my script but how to pass an existing object for example
John: TPerson;
and i want to pass John to my script and in script i want to set his age and so on…
I think its simple question and i hope i will get right answer
Thanks