contents   index   previous   next



SE.GLOBAL

The members of this object are the global variables of the script. For instance, the global variable zed is the member zed of this object. You can examine and change global variables by using this stock object. You can also change the global object itself by using using sePutObject on SE.GLOBAL,SE.VALUE.

 

Note that all functions remember the global object in effect when they were first created and swap that in when they are executing. This facilitates scoping where multiple scripts are executed using seEval, each with a new global object. The various functions remember their global object, so variables created with the var keyword in the script the function was evaluated in are accessible whenever the function is executing. For some programs, this behavior is undesirable. For instance, a person might want to create utility functions that always act on the variables in effect and run them with different global objects. There are two ways to change the behavior.

 

First, by turning off JSE_MULTIPLE_GLOBAL in your jseopt.jh file, this behavior is turned off completely. Alternately, you can turn the behavior off for any wrapper function by including the SE.KEEP_GLOBAL flag in the function flags used to define that wrapper function (see Chapter VII, wrapper functions for more details.)

 


SE.ARGS