contents   index   previous   next



PARAMS

 

This parameter is a pointer to a structure that contains several optional variables. You can pass NULL to not specify any of them. If you do pass a pointer to a structure, you can leave any element of this structure NULL to use the default for that element. Here are the fields of this structure:

 

seobject scopestart;

seobject scopeend;

 

The scope chain is how ScriptEase determines what a variable name is referring to. The scope chain is a list of objects. For a typical function, the list contains the activation object in which local variables are stored and the global object in which global variables are stored. The variables themselves are members of the object they are a part of. As a result, for a typical function, the local variables are searched first to try to resolve a variable name followed by the global variables. You can specify your own objects to be added to the list.

 

The scopestart and scopeend parameters are objects created using the seMakeStack API call. The members of these objects should themselves be objects to be added to the scope chain. In other words, SE_INDEX(0) should be the first object to be added to the scope chain, SE_INDEX(1) will be the second, and so forth. These objects are added at the start or end of the scope chain respectively. Those added at scopestart are searched first during script execution.

 

Note that during execution the scope object is searched from the highest index to the lowest. For example, if you provide a scopestart object with 3 members and a scopeend object with 2 parameters, when scopig a variables objects will be searched in this order

 

scopestart[2] -- this object searched first
scopestart[1]
scopestart[0]
.. inherited globals ..
this object if implicit this
this.__parent__ chain if implicit parents
activation object
scopeend[1]
scopeend[0] -- this object will be searched last

 

Adding objects to the start of the scope chain is analogous to a script execution inside a with statement. A with statement adds a single object to the start of the scope chain. scopestart allows you to add a list of objects, but the same principle applies. scopeend works similarly but adds objects to be searched after all other places to search for a variable name.

 

  seobject global;

 

Indicates a new global variable to evaluate the script using.

 

  seobject default_this;

 

The default_this parameter allows you to determine which object will be the this variable for the executed script or function. For a script, the NULL value is traditionally used which makes the global variable the default this for the evaluated script as well. For a function, if the function is being invoked as a member of some object, that object should be passed as the default_this variable instead.

 

seobject security_init;

seobject security_term;

seobject security_guard;

seobject security_object;

 

These are the standard security functions as described in the ScriptEase language manual chapter on security. These objects work exactly the same in the ScriptEase ISDK as they do for any other ScriptEase security application.

 

seconstcharptr filename;

uint line_num;

 

These parameters are used when the SE_TEXT form of script is executed. They specify the virtual filename and starting line number for the script text. This is helpful in reporting errors that might occur in the script text.


FUNCTION GLOBALS