![]() ![]() |
Mar 29 2007, 11:42 PM
Post
#1
|
|
|
No way... It compiles? SHIP IT! Group: Moderators Posts: 609 Joined: 27-December 04 From: Thunder Bay, Ontario Canada Member No.: 2,133 ![]() |
I know this is an extremely n00bish Question,
but how would I use the sleep command in VB? -------------------- -Mad_cow |
|
|
|
Mar 30 2007, 12:27 AM
Post
#2
|
|
|
SuperNova III Member Group: Support Team Posts: 2,141 Joined: 2-November 02 From: Toronto Member No.: 302 ![]() |
vb6
if you are on vb.net, use System.Threading.Thread.Sleep(10000) for a 10 sec sleep. it is odd i couldn't find the function documentations for vb6 on msdn but u should always first try msdn. |
|
|
|
Mar 30 2007, 02:15 AM
Post
#3
|
|
|
No way... It compiles? SHIP IT! Group: Moderators Posts: 609 Joined: 27-December 04 From: Thunder Bay, Ontario Canada Member No.: 2,133 ![]() |
I know I looked everywhere for this, and all the examples didn't work.
Thanks for the help. -------------------- -Mad_cow |
|
|
|
Mar 30 2007, 02:07 PM
Post
#4
|
|
|
SuperNova III Member Group: Support Team Posts: 2,141 Joined: 2-November 02 From: Toronto Member No.: 302 ![]() |
unless u r writing a console application, sleep usually doesn't do what u need. it freezes the main Thread which is ur UI Thread and UI freezing is not desirable.
if i want to delay some event i use a Timer in .Net (or start a new Thread) there should be such thing in VB6 too. a code fragment will help. somewhere i read that u need to declare an entry point to Sleep defintion in kernel32.dll. sounds like Sleep is not a vb function. (add at the top of ur page). actually u can name it whatever u want. CODE Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
|
|
|
|
Mar 30 2007, 03:29 PM
Post
#5
|
|
|
No way... It compiles? SHIP IT! Group: Moderators Posts: 609 Joined: 27-December 04 From: Thunder Bay, Ontario Canada Member No.: 2,133 ![]() |
This code worked fine, because it was in a duckhunt game, and I wanted the duck to delay for 300 miliseconds but nothing else had to work while it was delayed,
Thanks again. -------------------- -Mad_cow |
|
|
|
![]() ![]() |
|
Lo-Fi Version | Time is now: 25th May 2013 - 10:53 AM |