The routines in this section are not for the timid. They are included internally to the ScriptEase program, and are available to any ScriptEase program under any operating system.
Most of these routines allow the programmer to have more power than is generally acknowledged as safe under ScriptEase' guidelines. Be cautious when you use these commands, they provide plenty of rope with which to hang yours
InterpretInNewThread |
|
---|---|
DESCRIPTION |
Interpret a script in a new thread of current ScriptEase process. |
SYNTAX |
int InterpretInNewThread(string filename, string textToInterpret) |
COMMENTS |
This function creates a new thread within the current ScriptEase process and interprets a script within that new thread. The new script will run independently of the currently executing thread. This differs from interpret() in that the calling thread will not wait for the interpretation to finish, and it differs from spawn() in that the new thread will run in the same memory and process space as the currently running thread. It is up to the script writer to ensure any synchronization between threads; ScriptEase data and globals will be per-thread only. If filename is not NULL then it is the name of a file to interpret and textToInterpret will be parsed as if they are command-line parameters to the main() function. If filename is NULL then textToInterpret will be treated as pure ScriptEase code and interpreted directly. |
RETURN |
Returns the ID number of the thread containing the new instance of ScriptEase. If there is an error, 0 or -1 will be returned, depending on the operating system. |
NOTE |
This function is not supported on operating systems that do not support multithreading, such as DOS and 16-bit Windows. |