| || |
Error handling - multiple scripts run in a batch
I inherited a bunch of old scripts that i need to run overnight, in a batch script. These old scripts have no err handling, so my only err handling is at batch level:
'On Error GoTo errHnd_Shell
Set objTOnError = OnError("ErrHndFunction")
run "Script 1"
run "Script 2"
run "Script n"
Function ErrHndFunction() As tpOnErrorType
'write to a text file, etc...
ErrHndFunction = tpResumeNext
Now, my problem is the tpResumeNext.
When an err occurs in "Script 2", i want it intercepted (this works) and then i want to exit the problem script and start running the next script in the batch, "Script 3".
ResumeNext will force me to go through all the remaining lines in script 2, which is a waste of time. What i need is a kind of OnErr GOTO Label1, similar to VB's. Is there anything similar in TP?
Any other ideas are greatly appreciated.
Re: Error handling - multiple scripts run in a batch
If you can do it in VBA, you can probably do it in TP, since TP's scripting language is a superset of VBA.
Did you try your idea? If so, what happened?
Do you have QADirector available? You can use QAD to schedule all your scripts in a suite, and if one script aborts, it goes on to the next one. Just what you describe that you want it to do.