newObjects-logo.gif (1024 bytes) ScriptManager2 and ScriptAggregate reference
Stop method

Stops the running (or connected) script.

object.Stop()

object ScriptManager2 or ScriptAggregate Previously created ScriptManager2/ScriptAggregate object

Remarks:

Stops the running script - after calling the method object is again in the initialized state and can be restarted later. State of the script is the same as after initializing the script engine (LoadEngine) and adding the script code (AddText). The only difference is that property locked will return true. This will preserve the integrity of the namespaces collection - because the script already loaded can not be unloaded and thus it may need the namespaces in the collection. To completely uninitialize the script Close method must be called.

Method cares about the state of the script engine and if it is in the connected state it first disconnects it and then stops the script.

It is recommended (but not required) to call this method when cleaning up the component before reusing with new script. Example

// Clean up
host.Stop();
host.Close();

For ScriptAggregate obejct the script will be stopped in reverse order of the order in which they are started.

Applies to

ScriptManager2 and ScriptAggregate objects.

See also:

C++ Helper SCPHOSTCLNT::Stop method

newObjects Copyright newObjects 2001-2005