how to set variable in report's scripts

edited 12:19PM in FastReport 3.0
i have define a variable in my report, name is "var1",

i can get the var1's value

but i can't set the var1's value

////////this is my code

procedure Page1OnBeforePrint(Sender: TfrxComponent);
var
newvar:string;
begin
newvar:=<var1>;
<span style='color:red'><var1>:='08';</span>
end;

//////////////////////////////
<var1>:='08'; is error

Comments

  • edited 12:19PM
    i have found the key.


    Get('my variable')
    Set('my variable', 10);
  • edited 12:19PM
    It must be like this
    Report.Variables.Variables:=#39+Edit1.Text+#39;

  • edited 12:19PM
    yzsind wrote: »
    i have found the key.


    Get('my variable')
    Set('my variable', 10);

    how i can do this in basic script

    when i run the report , error expression expected is shown

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.