-
Hi,
I'm sure you all know the Sleep API? I would like to make a sub Sleep and not the whole program! If you have seen the Sleep API before you will be aware that it puts the entire program to rest even restricting you from moving the form around the screen with the title bar until the sleep time is up. Is there a way to just sleep a sub (without using a loop)?
Thanks
-
Simple. Don't use sleep. Either tell the code to stop executing and restart under certain circumstances, or:
Code:
While X <> 10
DoEvents
Loop
'Nothing happens till X = 10
-
Have a look at a tip by James Wilson
"How to delay a VB program without using the API"
URL: http://www.vb-world.net/misc/tip82.html
Hope this helps
GRAHAM
-
Another way
if continue then goto cont
.
.
continue=true
exit sub
cont:
.
.
continue=false
end sub