$SET
- Last UpdatedJan 05, 2026
- 1 minute read
Syntax
$SET (Variable) < Expression >
This command evaluates the supplied expression and assigns the result to the given variable. If the expression is omitted then the variable will be removed from the symbol table. Variables must have been previously declared by the $VARIABLE command before using this command. Expressions can be either numeric or character. The type of the variable determines the type of the expression.
Numeric expressions may use any of the operators described in the $EVALUATE command.
|
for example, |
$SET width 12.5 |
|
|
$SET height width^2.0 |
||
|
$SET OK a>b n.b. TRUE = -1 |
||
Character expressions consist of string concatenations.
|
for example, |
$SET name "PNT",num |
Sub-strings can be used in character expressions. The syntax of a sub-string is as follows:
variable([ start-pos] : [ end-pos ])
where:
|
|
start-pos |
= |
position of first character of sub-string. This can either be a numeric variable or constant. If omitted then 1 is assumed. |
|
end-pos |
= |
position of last character of sub-string. This can either be a numeric variable or constant. If omitted then 'string length' is assumed. |
|
|
for example, |
$SET sub-name name(2:5) $SET name old-name(:7) that means, first 7 characters $SET name "NEW",old-name(4:) |
||