Script Language: Statements: Scripts and Functions


Start vs. Call

A script may be called or started by any other script block. If a script is called, the caller waits for it to finish. When a script is started, it executes in the background while the current script also continues execution.


MyScript;       // call a script and ignore its return value
i = MyScript;   // call a script and use its return value
start MyScript; // start a script in the background
See Also...

Function Calls

A function is a predefined subprogram inside the interpreter. Some functions require parameters to be passed as a list of arguments.


suspend;           // no arguments without parens
suspend();         // no arguments with parens  
setPosition(x, y); // two arguments
setPosition x, y;  // two arguments, parens omitted

The last example above is not valid if the function is called from inside an expression.

If a function's return value is not specified, then it is zero. But many functions, such as the following, return a meaningful value.


choice = dialog();
color = RGB(100, 240, 0);
See Also...