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 that 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 currently in effect and thus run them with the current global objects. There are two ways to change the behavior.

 

First, by turning off JSE_MULTIPLE_GLOBAL in your jseopt.h 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 on "Wrapper functions" for more details.)

 


SE_ARGS