User Tools

Site Tools


docu_set

Set, update or delete a variable

Options

NameRequiredMultiple ValuesDescription
VARyesnoThe name of the variable
TOnonoThe value to be set
DEVICEnonoA label device to store the variables

The set action is using one single generic_label device to store all variables. By default the set action will look for a generic_label device named “_VARSTORE_”. This default can be overridden by adding a DEVICE statement defining different generic_label device.

If a TO statement is given, the variable will be set to the given value. If the variable doesn't exist yet it will be created.

If the TO statement is omitted, the variable will be deleted.

Varables created by the set action can be retrieved using the GETVAR function.

Examples

IF 1 == 1 THEN set VAR testvar TO foobar => Creates variable "testvar" in "_VARSTORE_" unless it already exists and sets its value to "foobar"

IF 1 == 1 THEN set VAR testvar => Deletes variable "testvar" from "_VARSTORE_"if it exists"

Both examples above will be using the default "_VARSTORE_" device. In the example below the "mylabel device is used instead"

IF 1 == 1 THEN set VAR testvar TO foobar DEVICE mylabel => Creates variable "testvar" in "mylabel "unless it already exists and sets its value to "foobar.

Note: variable names cannot contain &, =, space or any control character.

docu_set.txt · Last modified: 2018/08/17 17:11 by Niek