Simple Variables
Simple variables in Zephyr hold basic values. There are three types:
PT
: Printable Text (strings of characters)INT
: Integer (whole numbers)FLOAT
: Floating-point number (decimal values)
PT (Printable Text)
Represents a sequence of characters.
- usage:
myText # PT:HelloWorld!~|0;
- Parameters:
|~0
→ Marks the variable as non-constant (default).|~1
→ Marks the variable as constant (value cannot change).
INT (Integer)
Represents whole numbers without decimals. - usage:
myText # INT:123;
FLOAT (Floating-point Number)
Represents decimal values. - usage:
myText # FLOAT:3.1415;
Modifying Values
To modify variables, use the ? w:
operation.
usage:
<VariableName> ? w:<Value>;
<VariableName> ? w:'<AnotherVariableName>';
<VariableName>
→ Name of the variable you want to modify.
- VariableName
→ Must match the variable’s type.
- 'AnotherVariableName'
→ By entering any variable name inside ' ', its current value is copied.
Example:
a # INT:10;
b # INT:0;
b ? w:'a'; ~ b now holds the value of a → 10
Incrementing:
- Increment integer or float by 1 (or 1.0)::
counter ? w:++;
- Decrement integer or Float by 1 (or 1.0):
counter ? w:--;
- Increment PT:
printableText after increment: HelloWorldHelloWorld
printableText # PT:HelloWorld; printableText ? w:++;