Arrays as parameters in AddMethod
OK, I'm stuck again. How do you pass an array as a function parameter. From all the pascal samples I've read it looks like this is how:
fsScript1->AddMethod("function FUNC(x:array[1..10] of Integer) : void",ScriptFunction,NULL,NULL);
But, if I step through the code, when it get to this line the app just freezes.
Anyone know the correct way to do it?
fsScript1->AddMethod("function FUNC(x:array[1..10] of Integer) : void",ScriptFunction,NULL,NULL);
But, if I step through the code, when it get to this line the app just freezes.
Anyone know the correct way to do it?
Comments
fsScript1->AddMethod("procedure FUNC(x:array)",ScriptFunction,NULL,NULL);
//in my handle function I do this:
.....
Variant v;
v=Params.GetElement(4);
int i=99;
v.PutElement(&i,0);
........
//in script
{
int x[5];
FUNC(x);
showmessage(x[0]);
}
But I don't get 99 I get 0
v=Params.GetElement(0);