var
statement is used to create or update a variable which can subsequently be referenced by name in the USE script.[public] var
name [ = value]
[public] var
name operator number
[public] encrypt var
name = value
var
commandpublic
precedes a variable declaration then the variable will be shown in, and its value can be updated from, the Exivity GUI. Only variables prefixed with the word public
appear in the GUI (all others are only visible in the script itself). To make an automatic variable public, re-declare it with a value of itself as shown below:=
character. To use spaces in a variable value it should be quoted with double quotes.${
and post-fixing it with a }
. For example, a variable called outputFile
can be referenced using ${outputFile}
. If no value is specified, then the variable will be empty, eg:${variableName}
and ${VariableName}
are different variables.var
statement will update the value.var
statement it is necessary to enclose the expression in parentheses as shown above but both integer and floating point arithmetic can be performed.+=
, -=
, *=
, /=
or %=
can be used which will perform addition, subtraction, multiplication, (integer) division or modulo operations respectively.var x += 10
will add 10 to the value of x. Note that both the value in the variable and the value following the operator must be integers.+=
, -=
, *=
, /=
and %=
operators.${ARGC}
${ARG_N}
${ARG_N}
, where N is a number greater than or equal to 1, will be created whose value is the argument value associated with that parameter${DAY}
${DAY_NAME}
${DAY_UTC}
${DAY_NAME_UTC}
${GET_TIME}
Tue Jan 16 14:04:32 2018
${loop_label.COUNT}
1
on the first loop. If no loops are performed, then the variable will have a value of 0
${loop_label.NAME}
${loop_label.VALUE}
${loop_label.TYPE}
boolean
, number
, string
, array
, object
or null
.${HOUR}
${HOUR_UTC}
${HTTP_STATUS_CODE}
${HTTP_STATUS_TEXT}
${MINUTE}
${MINUTE_UTC}
${MONTH}
${MONTH_NAME}
${MONTH_UTC}
match day "(...)" ${DAY_NAME_UTC}
var short_day = ${day.RESULT}
.LENGTH
to the variable name when referencing it. For example, if a variable called result has a value of success then ${result.LENGTH}
will be replaced with 7
(this being the number of characters in the word 'success')..LENGTH
suffix can also be used to check for empty variables as follows:myvar.LENGTH
is not a variable in its own right. The .LENGTH
suffix merely modifies the manner in which the myvar
variable is used.