Pascalscript and var parameters
Hi,
i am also evaluating the script engine. I want to call a pascal script from my delphi. The problem is, i only get the values i have set before calling the script function.
I have a script with the following source:
Procedure GetPoints ( Var Value1, Value2 : Integer );
Begin
Value1 := 234;
Value2 := 567;
End;
My Delphi Source looks like
Var Params : Variant;
begin
Params := VarArrayOf([1, 2]);
if fsScript1.Compile then
Begin
fsScript1.CallFunction( 'GetPoints', Params );
ShowMessage ( Params[0]);
ShowMessage ( Params[1]);
End Else
BEgin
ShowMessage ( fsScript1.ErrorMsg + ' ' + fsScript1.ErrorPos );
End;
end;
i am also evaluating the script engine. I want to call a pascal script from my delphi. The problem is, i only get the values i have set before calling the script function.
I have a script with the following source:
Procedure GetPoints ( Var Value1, Value2 : Integer );
Begin
Value1 := 234;
Value2 := 567;
End;
My Delphi Source looks like
Var Params : Variant;
begin
Params := VarArrayOf([1, 2]);
if fsScript1.Compile then
Begin
fsScript1.CallFunction( 'GetPoints', Params );
ShowMessage ( Params[0]);
ShowMessage ( Params[1]);
End Else
BEgin
ShowMessage ( fsScript1.ErrorMsg + ' ' + fsScript1.ErrorPos );
End;
end;
Comments
Ulrich