Set or create global variable

make nazwa wartość
name wartość nazwa
nazwa := wartość

Stores the value in a variable with the name. The variable is searched for in the following order: among local variables first, then among global variables, and finally among shared variables. The instruction creates a new global variable, if variable with the name was not found.
Assignment operator := can be used instead of make.

Example:

The example shows how local and global variables are accessed: the global variable :x with the value 1 is accessible inside the function up to the moment when the local variable with the same name and the value of 5 is created. Changes made to the value of the local variable do not affect the global variable. Global variable :y that is created inside the function still exists after the function is finished.

to fun
  print :x
  let "x 5
  print :x
  make "y 2
end

make "x 1
fun
print :x
print :y

Output:

1
5
1
2

See also:

Variables in POOL
let, localmake - set or create local variable

Table of Content