decorative banner

Previous | Next               Table Of Contents > 2 Working with string and numeric variables > 2.1 Setting and updating variables

2.1 Setting and updating variables


A variable is automatically created and set to an empty string when first used. The setvar command or the strprint command can be used to set or update the values stored in a variable. A variable holds both numbers and strings and can be treated as a number or string based on the context.

The syntax is

setvar <variable>, <string or number>;

strprint <variable>, <sequence of comma separated strings, numbers, and variables>;

Some examples are

setvar ~my_number, 5;

setvar ~my_string, "this is a string";

strprint ~my_value, "the value is ", 5, " bytes";


Previous | Next