home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.visual.basic      MS Visual Basic discussions, NOT dot-net      10,840 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 10,087 of 10,840   
   Dikkie Dik to steve marchant   
   Re: stuck in loop. Please help   
   11 Jun 06 00:52:51   
   
   From: nospam@nospam.org   
      
   Putting a "DoEvents" in the loop should give VB the chance to listen to   
   the events of the second button.   
      
   steve marchant wrote:   
   > trying to learn VB6. Simple counting loop which counts to 8 in 1 sec   
   > intervals,  then starts from 1 again and repeats.   
   > Have two Command buttons on the form. Cmd1 starts the counting, and I need   
   > to know how to stop it with Cmd2. Here's my code so far:   
   > Private Sub Command1_Click()   
   > Dim x, y, m   
   >  m = 1   
   >   
   > Do   
   > Print m   
   > x = Timer   
   > Do Until Timer = x + 1   
   > y = Timer   
   > Loop   
   >   
   > m = m + 1   
   >   
   >   If m > 8 Then   
   >  m = 1   
   >  End If   
   >   
   > Loop   
   > End Sub   
   >   
   >   
   >   
   >   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca