Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 19th, 2006, 1:34 AM   #1
Intimidat0r
Hobbyist Programmer
 
Intimidat0r's Avatar
 
Join Date: May 2005
Location: Don't know, but the padded walls are a nice touch.
Posts: 126
Rep Power: 0 Intimidat0r is an unknown quantity at this point
Send a message via ICQ to Intimidat0r Send a message via AIM to Intimidat0r Send a message via MSN to Intimidat0r Send a message via Yahoo to Intimidat0r
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
Intimidat0r is offline   Reply With Quote
Old May 19th, 2006, 9:18 AM   #2
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
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."
Infinite Recursion is offline   Reply With Quote
Old May 19th, 2006, 9:24 AM   #3
kruptof
Professional Programmer
 
kruptof's Avatar
 
Join Date: May 2006
Location: UK - London
Posts: 333
Rep Power: 3 kruptof is on a distinguished road
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.
kruptof is offline   Reply With Quote
Old May 21st, 2006, 8:47 PM   #4
Eric the Red
Hobbyist Programmer
 
Eric the Red's Avatar
 
Join Date: Feb 2006
Posts: 214
Rep Power: 0 Eric the Red is an unknown quantity at this point
Use a different computer language.
__________________
Death smiles at us all. All a man can do is smile back.
Eric the Red is offline   Reply With Quote
Old May 22nd, 2006, 8:25 AM   #5
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
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.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old May 22nd, 2006, 8:40 AM   #6
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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
DaWei is offline   Reply With Quote
Old May 22nd, 2006, 5:25 PM   #7
Booooze
Expert Programmer
 
Booooze's Avatar
 
Join Date: Mar 2006
Location: Igloo
Posts: 710
Rep Power: 3 Booooze is on a distinguished road
Send a message via MSN to Booooze
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.
Booooze is offline   Reply With Quote
Old May 22nd, 2006, 6:00 PM   #8
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
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.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old May 22nd, 2006, 6:36 PM   #9
Booooze
Expert Programmer
 
Booooze's Avatar
 
Join Date: Mar 2006
Location: Igloo
Posts: 710
Rep Power: 3 Booooze is on a distinguished road
Send a message via MSN to Booooze
Quote:
Originally Posted by Ooble
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.
o.. Hmm. Must be thinking of something else then.
Booooze is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:29 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC