Variables can be declared and used locally within a script. Once declared a script variable can have a value assigned to it. Here is a simple example of a script variable in use:
PascalScript:
var
MyVariable: String;
begin
MyVariable := 'Hello!';
end.
C++ Script:
string MyVariable;
{
MyVariable = "Hello!";
}
The variable’s value can be displayed in a “Text” object, for example, by typing '[MyVariable]' into the object.
A variable’s name must be unique. This means the name must not duplicate the name of any other report object, standard function or constant. If there is an error in a script, a message will be displayed when the report is run and report construction will be stopped.
|