RTTI and defined...

Hello,



Delphi XE and version 6.5.2

I continue to find issues with code that works in one instance and not another.



Example (working)



procedure TALibrary.TimerSet(AMachine:TatVirtualMachine);

var

name:string;

index:integer;

value:variant;

result:boolean;

begin

value:=0;

result:=false;

index:=Scripter.GetInputArg(0);

name:=Scripter.GetInputArg(1);

value:=Scripter.GetInputArg(2);



//some code to handle the call



Scripter.ReturnOutputArg(result);

end;



In a script I can use:



value:=TimerSet(1,'EN',True);     <-----------works

or

value:=TimerSet(1,'EN','True');    <-----------works



and the everything works fine.



Example (does not work the same)



function TGPObject.FSTimerSet(index:integer; const field:string; value:variant):boolean;

begin



//some code to handle call



end;



The object is added:



   pScripter.DefineClassByRTTI(TGPObject);   

   pScripter.AddObject('p', aGPElement);



Now using it in a script.



value:=p.TimerSet(2,'EN',True); < ------------fails with a convert error



value:=p.TimerSet(2,'EN','True'); <-----------works



I am continue to wait on the issue for passing an array from a script to an object function. I sent you an example project that reproduces the error.



Thanks for your time,



Mark







I believe the patch I sent to you will also fix this problem.

Hello,





You are correct and thank you for all your patience and help.

Ciao,

Mark