|
-
Apr 29th, 2000, 04:39 AM
#1
Thread Starter
Lively Member
How can i make a delay function like the one in pascal ??
-
Apr 29th, 2000, 05:10 AM
#2
Registered User
Use the timer function.
Just try this piece of code:
Code:
Private Sub Command1_Click()
Dim Start
Start = Timer
Do While Timer < Start + 3
DoEvents
Loop
MsgBox "Paused for 3 seconds"
End Sub
Hope this helps...
Lior, An Israeli Programmer.
-
Apr 29th, 2000, 05:33 AM
#3
transcendental analytic
Or use this API
Code:
Declare Function GetTickCount Lib "kernel32" Alias "GetTickCount" () As Long
and replace Liors timer with Gettickcount if u want precision in millisecs
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Apr 29th, 2000, 06:36 AM
#4
Frenzied Member
or look at my post here http://forums.vb-world.net/showthrea...threadid=15229 for precision in microseconds
-
Apr 29th, 2000, 04:02 PM
#5
Fanatic Member
Or...
Use the Sleep API for a total pause. (The user can't do
anything to your program):
Code:
Public Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)
and
Code:
Sleep (5000)
MsgBox("Tihihi. Thought I'd crashed, didn't you?")
I use this to make the user think that my program is dealing
with memory and all that (muhahahahah)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|