the simple answer is after t++; add
if (t==60) t=0;
but then, you would be trapped in the loop forever. So, there must also be some condition to escape the loop.
jdc
jingodelcuyo wrote >>
the simple answer is after t++; add if (t==60) t=0; but then, you would be trapped in the loop forever. So, there must also be some condition to escape the loop. jdc
the simple answer is after t++; add if (t==60) t=0; but then, you would be trapped in the loop forever. So, there must also be some condition to escape the loop. jdc
That's great! It worked. I was just writing it out wrong.
if ( t == 60 )
{ t == 0 }
BASIC was easier.
100 FORT=0TO60:NEXTT
200 ?T
300 GOTO100
Thanks again! Knew it had to be simple.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Here's a simple loop which counts from 0 to 60. How do I get this loop to start over again at 0?
int start()
{
int t=0;
while (t<60)
{
Sleep(1000);
Alert (t);
t++;
}
//----
return(0);