Declaring Script Variables
Previous Topic  Next Topic 

Script variables can be declared and used locally within a script. Once declared a script variable can have a value assigned to it.   A variable’s name must be unique. This means the name must not be duplicated the name of any other report object, standard function or constant. 


The example below shows a declaration and assignment of script variable in use:


  var

    MyVariable: String; 

  begin

    MyVariable := 'Hello!'; 

  end.


The variable’s value can be displayed in a Text object on the report by typing [MyVariable] into the text object.  The [ and ] brackets tell the report engine to display the variable named within the brackets.