Serves for organizing cycles with condition checking.
syntax
CODE:
int a=0;
while (a <5) // will be executed if a is less than 5
{
messagebox (a);
a ++;
}
while (a <5) // will be executed if a is less than 5
{
messagebox (a);
a ++;
}
CODE:
int tim=gettime ();
while (gettime () - tim <2000) beep (1000, 100); // run until it has been 2 seconds ..
while (gettime () - tim <2000) beep (1000, 100); // run until it has been 2 seconds ..
multiple verification is allowed && ||
CODE:
int tim=gettime ();
while (gettime () - tim <20000 && getkeystate (20) == 0) beep (2000, 50); // executes within 20 seconds, but can be aborted by clicking on CapsLock
while (gettime () - tim <20000 && getkeystate (20) == 0) beep (2000, 50); // executes within 20 seconds, but can be aborted by clicking on CapsLock
nested
CODE:
int a=0;
while (a <5) // will be executed if a is less than 5
{
int tim=gettime ();
while (gettime () - tim <500) beep (1000, 100); // will be executed until 2 seconds pass.
messagebox (a);
a ++;
}
while (a <5) // will be executed if a is less than 5
{
int tim=gettime ();
while (gettime () - tim <500) beep (1000, 100); // will be executed until 2 seconds pass.
messagebox (a);
a ++;
}