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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sleep command

Status
Not open for further replies.

psguy7

Programmer
Sep 21, 2005
4
US
Hi,

I'm looking for help using the Sleep Method. Can anyone show me an example of how to use it. I want to pause a For loop for 12 seconds to make a slideshow.
 
WScript.Sleep(12000)

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Thanks for the WScript tip. However I'm not familiar with it and have not used WScript. WScript.Sleep(12000) does not work in VBscript, so do I have to download this WScript from Microsoft to the server to get this command to work.

Thanks, and I to enjoy the depths of insanity at times!
 
hmm wscript is part of the windows scripting host (object lib?) if your code is in a vbs file or wsf file then this will work. i guess if you are on a server then you are talking about ASP?
 
Yes, pausing within a web page is a completely different proposition all together. Is that what you are trying to do?

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Yes, I'm trying to build a slideshow on a Webpage, so I need this to pause on the server. So I guess I should go to Microsoft and download the WSH, and it will work. Does that sound correct to you?
 
The WSH is not your problem. Your problem stems from the fact that IE security will not let you create a WScript object.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
>So I guess I should go to Microsoft and download the WSH, and it will work. Does that sound correct to you?
No, you go for window.setTimeout() method of the dhtml page.
 
Window.setTimeOut idea... Thanks that was a good idea. It works just fine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top