Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Urgent - Setting a timer

Status
Not open for further replies.

EzehM

Programmer
Feb 27, 2003
86
GB
I have a vbscript that calls a function. However this function for some reason doesnt seem to return. I have no access to the code of this function. Its some third party function. My question is this: Is there a way I could set a timer or do something, so that if the function doesnt return after a given period, I can gracefully exit the script.

e.g
WScript.StdOut.WriteLine "I am about to call function a"
' call function a
b = a("hello", "bye")
WScript.StdOut.WriteLine "out of function a"

' Function a
Function a(p, q)

.... Stuck in an indefinite loop

End Function

 
Have you tried putting

wscript.timeout = 15 'in seconds

under your Option Explicit?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top