How to Add an Array to a Script

edited 12:14AM in FastScript
I need to add an array of currency values from my Delphi program into my script so it can be used as a variable within the script.

I know that within a script, I can add code like this:
arr[1] := 100;
arr[2] := 200;
arr[3] := 300;

But I need to create it within my program and make it available within the script. Is this possible?

Thank you.

Jack

Comments

  • edited 12:14AM
    I got an answer from Paul Gurskey in support and I am posting it here in case it is helpful to anyone else:

    Use in Delphi:
    var a: variant; 
    begin 
    a:=VarArrayOf([1,2,3]); 
    frxReport1.Script.Variables['a']:=a; 
    frxReport1.ShowReport(); 
    end;
    
    in script:
    procedure Memo1OnBeforePrint(Sender: TfrxComponent); 
    begin 
    Memo1.Text:=a[2]; 
    end;
    

Leave a Comment