The var
statement is used to create or update a variable.
A number of variables are automatically created before the commencement of a Transcript task. Please refer to the Variables section in the Introduction to this guide for further details.
var
name
=
value
As the value may be derived from an expression (see Using an expression to set a variable below) it is recommended that variable values be quoted in order to avoid characters such as /
being interpreted as mathematical operators.
A variable is a named value. Once defined, the name can be used in place of the value for the rest of the transcript task. This can be useful in that it permits configuration of various parameters at the top of a transcript task, which makes maintenance easier.
Both the name and the value parameters must be present, and there must be a space on each side of the =
character. To use a space or tab in a variable value, use an escape or double quote the value:
A variables is referenced by enclosing its name with ${
and }
. For example a variable called outputFile
can be referenced using ${outputFile}
.
Variable names are case sensitive, therefore ${variableName}
and ${VariableName}
are separate variables.
If there is already a variable called name then the var
statement will update the value.
The value of a variable may not exceed 1023 characters
As well as a literal value, an expression may be specified, in which case the variable is set to the output of that expression. For example:
For a full list of available functions please refer to the functions section of the documentation for the if statement.