Home > Software engineering >  Interrupt ScriptControl performed in the script
Interrupt ScriptControl performed in the script

Time:10-11

I use the VB program execution VBS script,
Now want to interrupt the script is run by the program,
Not close the VB program,
Ask for advice

CodePudding user response:

http://bbs.csdn.net/topics/350085293
I saw this post, and I need about the same, but did not specify how to implement the interrupt,

CodePudding user response:

Use a thread to execute the script, end thread to suspend directly

CodePudding user response:

Or they can create a script errors, let the script terminates

CodePudding user response:

reference taoguangye reply: 3/f
or make a script errors, let the script termination

How when want to pause to make a script error, add the executing scripts from the changed

CodePudding user response:

reference 1st floor u014050895 response:

http://bbs.csdn.net/topics/350085293I saw this post, and I need about the same, but did not specify how to implement the interrupt,

The thread is still not the end of the script is running,

CodePudding user response:

To write their own can throw the wrong object to VBS calls, when need to terminate the call this object to throw an error

CodePudding user response:

There is no direct interface can be invoked, ScriptControl seems only synchronization, is a single-threaded

Compromise to passing a VB script code object, such as:
AddObject (' objForm 'form1)
Form1 add methods IsExit ()

When ScriptControl AddCode, add one line of code in each line in the script,
If objForm. IsExit then throw a can't continue to mistakes,

When to stop let IsExit returns TRUE

's hard, not too good, if you are writing script is good, otherwise the insert this judgment out of line of code that hurt
  • Related