Results 1 to 4 of 4

Thread: Easy Q

  1. #1

    Thread Starter
    Addicted Member Skeen's Avatar
    Join Date
    Jul 2000
    Location
    Abingdon, Oxon
    Posts
    138

    Talking

    This probably sound really stupid,

    But how do you get a VB program to wait, to just loop/count for a bit without handling any external data?

    Cheers 'n' beers
    Skeen
    "It wasn't the booze that made me snooze, It was the Gin that did me in!"

  2. #2
    Fanatic Member wildcat_2000's Avatar
    Join Date
    Nov 2000
    Location
    Italy
    Posts
    727
    Normally VB programs do wait for events to happen, unless you specifically set timers who trigger events.

    Could you please be more specific?

    If what you are referring to is just setting a wait timer, then you may try this:

    Code:
    Sub Pause(Interval As Integer)
        Start = Timer
        Do While Timer < Start + Interval
            DoEvents
        Loop
    End Sub
    [Edited by wildcat_2000 on 11-17-2000 at 05:25 AM]

  3. #3
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    Try the sleep api

    Code:
    Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
    Private Sub Form_Load()
        Sleep 5000 'sleep for 5 seconds
    End Sub
    
    'OR JUST LOOP
    For x = 0 to 1000000
    next x
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  4. #4

    Thread Starter
    Addicted Member Skeen's Avatar
    Join Date
    Jul 2000
    Location
    Abingdon, Oxon
    Posts
    138

    Smile

    Cheers Guys

    Amate of mine just told me about the sleep API and I reckon thats perfik for me - I'm waiting for a command line to execute before the program can continue - and its populating a table with around 5000 record so it takes afew seconds.

    Cheers though

    Skeen
    "It wasn't the booze that made me snooze, It was the Gin that did me in!"

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