Results 1 to 2 of 2

Thread: can i create a loop on one command button and stop on another?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2002
    Posts
    352

    can i create a loop on one command button and stop on another?

    Ok... can i make a loop when you press command1 and then have it stopped when you press command2.

    I'm not worried about any lagg or w/e... but i'm curious if this works. I dought it'll lagg since i have two processors, but jw if this is possible.

  2. #2
    Frenzied Member andreys's Avatar
    Join Date
    Sep 2002
    Location
    Los Angeles
    Posts
    1,615
    Yes, you can

    Code:
    'declare variable
    Dim StopLoopFlag as boolean
    
    Private Sub cmdStart_Click()
    
    StopLoopFlag = True
    do while StopLoopFlag 
         Do your things....
         DoEvents
    loop
    
    End Sub
    
    
    
    Private Sub cmdStop_Click()
    
         StopLoopFlag = false
    
    End Sub

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