TMS Scripter Variant Array

I want to pass a Variant array to the Scripter and use the values in a calculation on the Scripter side. The code used to create the array on the Delphi side is shown below. In the Scripter the vArray is recognized as a Variant Array of Integer and the length is confirmed to be 4 and VarIsNull test false.
The problem is that when I want to retrieve a array value in the Scripter e.g. vArray[2] then I get the following message:
"Invalid array indexing for property 'vArray'. Expected 0 dimensions."

//------------------------------------------------
var
vArray: Variant;

begin
vArray := VarArrayCreate([0, 3], varInteger);
vArray[0] := 0;
vArray[1] := 10;
vArray[2] := 20;
vArray[3] := 30;

IDEScripter.AddVariable('vArray', vArray);
end;
//------------------------------------------------

I have seen the paragraph below in the documentation, but since the Scripter side recognized the array I assumed it would be able to retrieve the values?

"Some methods having parameters of "uncommon" types (such as arrays and others) are not defined in scripter, since Delphi does not provide enough information about these methods."

I found the solution to my problem here, where the Workaround is shown:

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.