EASI variables were designed to allow speed, flexibility and, above all, modularity. By declaring variables local the user is guaranteed that no other procedure has access to those variables. Global variables, however, can be accessible to other procedures; no accidental cross-references can be made between the two types of variables.
The following give examples of variable interaction and scope rules.
global integer a,b define function X() local integer b a=1 b=2 enddefine define function Y() a=5 b=6 enddefine run Y print "a = ",a, "b = " b run X print "a = ",a, "b = " b
The result after running procedure Y would be:
a = 5 b = 6
Then, the result after running procedure X would be:
a = 1 b = 6
Procedure Y uses global a and b, and the procedure X uses the global a and a local variable b; thus the assignment "b=6" in procedure Y assigns 6 to the global variable b. However, since procedure X declares b to be local to, there is no connection between the local variable b in procedure X and the global variable b in procedure y (i.e., the fact that they have the same name is of no importance; they are separate variables stored in separate memory locations).
One significant advantage for connecting values through the careful use of locally and globally declared variables is achieving greater modularity. It becomes possible to connect collections of procedures together without having global variables in one procedure affected by the global variables used in a called procedure.
© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.