I have this script:
procedure calc(options: TMyOptions);
begin
end;
On script compile USES I have added the SET OF declaration type:
Sender.AddTypeS(‘TMyOption’, ‘(op1, op2, op3)’);
Sender.AddTypeS(‘TMyOptions’, ‘set of TMyOption’);
This is how I call the proc in script from my Delphi Code:
// script compiled and loaded to psExec!
pList := TPSList.Create;
prm := CreateHeapVariant(fExec.FindType2(btSet));
value := [op1, op3];
move(value, prm^.data, sizeof(value));
pList.add(prm);
psExec.RunProc(pList, procNo);
This call result on an error:
“Type mismatch.”
What I’m doing wrong ?