To make a name local to a user-defined function, it must be contained in the
function header. For example, the function header VZtEXAMPLE X;J;I estab-
lishes the result variable 2, the argument X, and variables J and I as local variables,
Notice that the local names, other than the result variable and arguments, follow
the right argument (if any) and are preceded by semicolons.
A local name can be the same as a global name (variable or user-defined function)
or a local name in another function. However, any reference to the name local
to the function will not change the values of any other global or local objects
(variables or user-defined functions) or cause them to be used.
After a user-defined function has executed, the following rules apply to the local
and global variables used by the function:
Any value assigned to a local variable is lost.
If a local variable had the same name as a global variable, the value of the glo-
bal variable remains unchanged.
If the value of a global variable was changed by the function, it retains the
new value.
140
function header. For example, the function header VZtEXAMPLE X;J;I estab-
lishes the result variable 2, the argument X, and variables J and I as local variables,
Notice that the local names, other than the result variable and arguments, follow
the right argument (if any) and are preceded by semicolons.
A local name can be the same as a global name (variable or user-defined function)
or a local name in another function. However, any reference to the name local
to the function will not change the values of any other global or local objects
(variables or user-defined functions) or cause them to be used.
After a user-defined function has executed, the following rules apply to the local
and global variables used by the function:
Any value assigned to a local variable is lost.
If a local variable had the same name as a global variable, the value of the glo-
bal variable remains unchanged.
If the value of a global variable was changed by the function, it retains the
new value.
140