Can a timeout be detected?

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
chihuahualand
Junior Coder
Posts: 35
Joined: Thu Jan 12, 2006 9:20 pm
Contact:

Can a timeout be detected?

Post by chihuahualand » Thu Sep 07, 2006 6:45 pm

Is there a way to tell that the ASK_TIMEOUT has expired?

version 7.4.009

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Thu Sep 07, 2006 7:22 pm

If Ask times out the result is YES. It is designed this way to allow the script to assume an affirmative response should no user be present and allow the script to continue.

If you want to you could measure the elapsed time as well and make further decision based on that:

Code: Select all

VBSTART
VBEND

Let>TOSECS=5

Let>ASK_TIMEOUT=TOSECS*1000
VBEval>Timer,starttime
Ask>Yes or No,result
If>result=YES
  VBEval>Timer-%starttime%,endtime
  If>endtime>TOSECS
    MessageModal>Must have timed out
  Endif
Endif
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts