John Cherry
John Cherry

Reputation: 189

Is there a vbscript equivalent to Javascript's setTimeout?

JavaScript has a very hand setTimeout function that can be used to delay execution of a chunk of code. Is there something equivalent in vbscript ?

Upvotes: 1

Views: 2592

Answers (1)

Hackoo
Hackoo

Reputation: 18827

From this link

<html>
<head>
<script language="vbscript">
dim x : x=0
dim i : i=0
function myfunction()
    x=100
    i=i+1
end function

function mymonitor()
    msgbox ("i=" & i & vbcrlf & "x=" & x)
end function

sub window_onload
    setTimeout "myfunction()",1000
    setTimeout "mymonitor()",2500
end sub
</script>
</head>
</html>

Upvotes: 1

Related Questions