Kibor Bot Autoclicker » Kibor - Integrated development environment for bots » About Kibor » Version 5.37 Adding a continue statement

Страниц (1): [1]
 

1. Kibor - 24 Июля, 2018 - 05:18:08 - перейти к сообщению
The operator continue is used only in cycles. In cycles for , while , loop , looptime, operator continue skips the remainder of the code of the loop body and goes to the next iteration of the loop.

Example on the cycle for
In this case, both signals will sound 5 times
CODE:
for (int n=0; n <5; n ++)
{
beep (1000, 100);
beep (2000, 100);
}


In this case, everything that is after continue will be skipped.
CODE:
for (int n=0; n <5; n ++)
{
beep (1000, 100);
continue;
beep (2000, 100);
}



Example on the cycle while
In this case, the signal will sound five times
CODE:
int n=0;
while (n <5)
{
beep (1000, 100);
n ++;
}


In this case, n ++ will be skipped and there will be a closed loop
CODE:
int n=0;
while (n <5)
{
beep (1000, 100);
continue;
n ++;
}

Powered by ExBB FM 1.0 Final