How do i stop a script within the script?
Never had to do this, but I dug some info up for you.
There is IActiveScriptSiteInterruptPoll, with the single method QueryContinue(). Both the VBScript and JScript engines query for it, and when you return S_FALSE from QueryContinue(), the script stops executing.
So say you wanted to run a script within a user interface. While the script is running, you display a "please wait" dialog box with a "stop" button on it. When the user presses the button, set your m_bQuit flag to TRUE, and then implement QueryContinue like this.
STDMETHOD(QueryContinue)()
{
// ... pump any windows messages so the stop button can be pressed
if (m_bQuit)
return S_FALSE;
return S_OK;
}
or you could just set a flag and bypass remaing code if flag is set
here is vbscript language reference.
http://msdn.microsoft.com/library/default....oriVBScript.asp