Re: VBScript - Wait

by Doug Miles <douglas_miles(at)yahoo.com>

 Date:  Tue, 14 Nov 2000 09:30:51 -0600
 To:  "Cyanide _7" <leo7278(at)hotmail.com>,
hwg-languages(at)hwg.org
 In-Reply-To:  hotmail
  todo: View Thread, Original
At 03:48 PM 11/13/2000 -0600, Cyanide _7 wrote:
>   I'm pretty sure I've seen something along these lines before, but I 
> can't find it for the life of me. Does VBScript, specifically in ASP, 
> have something along the lines of "wait". basically pause the script for 
> a set period of time. i've tried just wait, server.wait, response.wait, 
> and even request.wait. Is this just a pipe dream, or does this really 
> exist? - Cyanide_7

You can write a small function to wait for you.  This one allows you to 
pass in the number of seconds and will wait that amount of time unless it 
happens to be just before midnight.  The Timer() function built into 
vbscript returns the number of seconds since midnight.

sub WaitSeconds(nSeconds)
dim t

         ' Wait the specified number of seconds.  But if the
         ' end-of-wait time is beyond midnight then don't wait.
         t = timer() + nSeconds
         if t < 86399 then       ' 86400 = 24 hrs * 60 minutes * 60 seconds
                 while timer() < t
                 wend
         end if

end sub


_________________________________________________________
Do You Yahoo!?
Get your free (at)yahoo.com address at http://mail.yahoo.com

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA