contents   index   previous   next



TEXT_ARGS, STACK_ARGS

 

The next two parameters are likewise related. You can pass arguments to your script or function via one of them. stack_args takes precedence so if you use them both the text_args are ignored. In either case, the arguments are extracted and passed to the called script or function. For a function, these are just standard arguments. Script arguments are treated like argc and argv for the main function in a C program. They are stored for the script in the global variables _argc and _argv.

 

For text arguments, specify the arguments in a text string, i.e. "-v foo". This is parsed in exactly the same way as a command line; white space is used to separate the arguments, and each is turned into a string in the _argv array. For stack_args, you pass in a ScriptEase stack object created via the seMakeStack ScriptEase API call. The arguments are defined by setting members of this object numerically using the SE.INDEX() member format. In other words SE.INDEX(0) is the first argument, SE.INDEX(1) is the second, and so forth. This form of parameter passing is more commonly used for functions. Most scripts that handle arguments expect all of their arguments to be text strings. If you pass a script arguments that are not text strings, such as numbers or objects, you will probably confuse it.

 

When you call a function that passes any parameters by reference, the arguments in the stack object will be updated appropriately, so you can check their final value before destroying the stack object after the function returns.

 


FLAGS