newObjects-logo.gif (1024 bytes) ScriptManager2 reference
Run method

Runs the script.

variable = object.Run()

variable boolean true if the operation was successful and false if not
object ScriptManager2 Previously created ScriptManager2 object

Remarks:

After loading the script code (see AddText method) Run method can be called to run the script.

Running script means executing of the all global script code and parsing definitions of the functions/subs in the text. For many applications this is enough i.e. loading some script and executing it. Thus script text is some kind of sequential commands (possibly helper/library functions) and the script is executed once in order to do its work.

Most advanced usage of the Active Scripts is to use Run method only just a preparation for later usage. After the method returns (with success status) global functions/subs defined in the script can be called randomly by the hosting application (global data variables can be accessed too). In this case script acts as a flexible component that provides services to the hosting application. Script is not loaded and not reinitialized between operations and it works a times faster then in the case of executing the entire script for every action.

Take a look at the MFC example - it uses script to control window repainting.

See also:

C++ Helper SCPHOSTCLNT::Run method
script property

newObjects Copyright newObjects 2001-2005