![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
|
Sleeping
I want my program to stop execution and wait for one second before continuing. Typically in other languages this is accomplished with some variation of the 'sleep' function, like sleep(1000) or whatever.
Unfortunately I am unable to find such a function in VB6. Searching the forums yielded a result in which the topic starter was intructed to use the Sleep function, but this doesn't work for me (function does not exist, ...). Any help? Thanks ![]()
__________________
Children in the dark cause accidents, and accidents in the dark cause children. http://www.ronincoders.org |
|
|
|
|
|
#2 |
|
Programming Guru
![]() ![]() ![]() |
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) 'Try it out Sub Command1_Click() Call Sleep(1000) End Sub
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
|
|
#3 |
|
Professional Programmer
Join Date: May 2006
Location: UK - London
Posts: 333
Rep Power: 3
![]() |
why don'y you just lock all the controls on the forum for a given amount of time using the a timer you can then unlock the controls when the time that you have specified has passed.
|
|
|
|
|
|
#4 |
|
Hobbyist Programmer
Join Date: Feb 2006
Posts: 214
Rep Power: 0
![]() |
Use a different computer language.
__________________
Death smiles at us all. All a man can do is smile back. |
|
|
|
|
|
#5 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Or... here's an idea... you could do exactly what IR said. I'd be the first to agree that VB isn't the best of languages, but this is not a reason I'd give for switching.
|
|
|
|
|
|
#6 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
I know it sounds silly, but if switching had been an option, he'd have posted in the "What Language Should I Switch To" forum....
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#7 |
|
Expert Programmer
|
I've never thought of kruptof's idea, but it sounds good because if I remember correctly, the sleep function in vb is not very good.
|
|
|
|
|
|
#8 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
The Sleep function is pulled straight from kernel32.dll. In other words, it's the same one that the Win32 API in C++ uses. You're not gonna get much better easily.
|
|
|
|
|
|
#9 | |
|
Expert Programmer
|
Quote:
|
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|