Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


WScript.Sleep problem

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,26437
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> WScript.Sleep problem
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 WScript.Sleep problem - 9/27/2005 7:22:34 PM   
  psguy7

 

Posts: 3
Score: 0
Joined: 9/27/2005
Status: offline
Hi, I'm new with WScript.  I want to use it to stop a loop in vbscript.  Here is what I have.  What else do I have to do to get this to run?

thanks,

<%
set WshShell = WScript.CreateObject("WScript.Shell")
for x = 1 to 5
response.write " its about time" & "<br>"
WScript.Sleep 250
next
%>

 
 
Post #: 1
 
 RE: WScript.Sleep problem - 9/27/2005 7:45:25 PM   
  Zifter


Posts: 318
Score: 0
Joined: 1/5/2005
From: Belgium
Status: offline
Hi psguy7 and


"WScript.Sleep 250" is a statement that only works in "stand-alone" scripts (.vbs, .wsf)
When you use VbScript in a webpage (.html, .hta, .asp, ...) you'll need to use "window.setTimeout"

In stand-alone scripts:

      

The same in webpages becomes:

      

(in reply to psguy7)
 
 
Post #: 2
 
 RE: WScript.Sleep problem - 9/28/2005 12:03:19 AM   
  kancnspace

 

Posts: 5
Score: 0
Joined: 9/27/2005
Status: offline

      

(in reply to psguy7)
 
 
Post #: 3
 
 RE: WScript.Sleep problem - 9/28/2005 7:38:33 AM   
  psguy7

 

Posts: 3
Score: 0
Joined: 9/27/2005
Status: offline
I don't think window.settimeout will work in this situation.  This is server side code only.  I need to control a loop in vbscript on the server, not in html.  WScript.Sleep does not work either.  How would pause/sleep a loop?  An example would be nice.  I can't find one anywhere.

thanks.

<%
set WshShell = WScript.CreateObject("WScript.Shell")
for x = 1 to 5
response.write " its about time" & "<br>"
WScript.Sleep 250
next
%>

(in reply to psguy7)
 
 
Post #: 4
 
 RE: WScript.Sleep problem - 9/28/2005 7:47:33 AM   
  Country73


Posts: 733
Score: 10
Joined: 8/25/2004
From: USA
Status: offline
Here's an example of Sleep in a loop, not sure if it will work with what your wanting or not.


      

Here's a link showing the sleep function in loop for an ASP page.

< Message edited by Country73 -- 9/28/2005 7:51:18 AM >

(in reply to psguy7)
 
 
Post #: 5
 
 RE: WScript.Sleep problem - 9/28/2005 10:14:05 AM   
  psguy7

 

Posts: 3
Score: 0
Joined: 9/27/2005
Status: offline
AS far as I can tell, windows scripting does not run on a server.  Its a desktop and command prompt technology.  I guess I'm going  to have to find some other way of stopping/pausing a server side script.


(in reply to psguy7)
 
 
Post #: 6
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> WScript.Sleep problem Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts