Results 1 to 3 of 3

Thread: Tell it to Wait

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2000
    Location
    Greenville
    Posts
    73
    I want my code to 'Wait' or 'Sleep' while I am pasting things into a document. But How To Do??? I was thinking maybe count seconds? But How TO DO? Any Suggestions?

  2. #2
    Serge's Avatar
    Join Date
    Feb 1999
    Location
    Scottsdale, Arizona, USA
    Posts
    2,744
    You can do something like this:
    Code:
    Public Sub TimeOut(pInterval As Single)
        Dim sngTimer As Single
    
        sngTimer = Timer
    
        Do While Timer < sngTimer + pInterval
            DoEvents
        Loop
    End Sub
    Then you can call this routine like this:

    Call TimeOut 5

    This will pause for 5 seconds.

  3. #3
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Boulder, Colorado, USA
    Posts
    325

    Lightbulb Waiting.....

    Here is one way...

    Sub Wait(byval time_ms as Single)

    Dim TimeToWait as Single

    TimeToWait = Timer + time_ms

    Do: DoEvents: Loop Until (Timer >= TimeToWait)

    End Sub

    get the idea?
    -Shickadance

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