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

Using setTimeout

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi,

I am trying to get a set of functions in VBScript to be called repeatedly, after a certain delay. Is it possible to make recursive calls in VBScript or use the setTimeout() function to do this?

Thanks
 
Newer browsers can use setInterval. Example:

Code:
<script language=&quot;javascript&quot;>
var delay = 5*1000 //5 seconds
setInterval(&quot;fnAlert()&quot;,delay)

function fnAlert(){
 alert(&quot;Hello&quot;);
}
</script>

Otherwise use this recursive function...

<script language=&quot;javascript&quot;>
var delay = 5*1000 //5 seconds
setTimeout(&quot;fnAlert()&quot;,delay)

function fnAlert(){
 alert(&quot;Hello&quot;);
 setTimeout(&quot;fnAlert()&quot;,delay)
}
</script>

Hope this helps,
[sig]<p>Rob<br><a href=mailto:robschultz@yahoo.com>robschultz@yahoo.com</a><br>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br>
"Focus on the solution to the problem,<br>
not the obstacles in the way."<br>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~[/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top