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,102 of 10,840    |
|    Angelo to All    |
|    Re: stuck in loop. Please help    |
|    15 Jun 06 19:05:03    |
      From: angelo2@lancop.invalid              I think the best way to do it is to use a Timer wich does every ...       milliseconds 1 to the variable and shows it. do not use a do loop then. You       can enable it, (starting the count) by using Timer1.Enabled = True, and       disable it, (stopping the counter) by using Timer1.Enabled = False.              Hope this is good information.              Grtz.              > 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