Results 1 to 5 of 5

Thread: Delay

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2000
    Posts
    84

    Question

    How can i make a delay function like the one in pascal ??

  2. #2
    Registered User Lior's Avatar
    Join Date
    Jan 2000
    Posts
    307

    Post 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.

  3. #3
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221

    Wink

    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.

  4. #4
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    or look at my post here http://forums.vb-world.net/showthrea...threadid=15229 for precision in microseconds

  5. #5
    Fanatic Member
    Join Date
    Apr 2000
    Location
    Whats a location?
    Posts
    516

    Lightbulb 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)
    Courgettes.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width