Constant type | Examples |
integers | 5 -20 0 32000 |
floating-point numbers | 3.1415926 2.0 -6592.582 0.0 |
identifiers (only letters, digits and underscore) | pCube1 |
strings (enclosed between double quotes) | "MEL is fun!" "abcdef012345" ":<>()&^%ABC" |
Variables
A constant can be replaced by a variable, that is a reference to a value that is elsewhere stored and that can be changed between executions of the script or during the execution of a script.
Variable type | Default value |
int | 0 |
float | 0.0 |
string | "" |
int $height = 2;
polyCube -w 1 -h $height -d 1;
Variable assignments
Once a variable is declared, it can be assigned a (new) value using the assignment operator =
int $width;
$width = 2;
polyCube -w $width -h $height -d 1;
$width = $width + 1;
polyCube -w $width -h $height -d 1;