Download HMI User Manual - Future Design Controls

Transcript
}
Result, Tag1 = 6 when above script is executed
7.10.2 Continue
Any remaining statements in the current iteration are not executed. It is used to bypass a
section of a code. The next iteration of the loop is determined as follows:

In a while loop, the next iteration starts by reevaluating the controlling expression
of the while statement.

In a for loop (using the syntax for(init-expr; cond-expr; loop-expr)), the loop-expr
clause is executed. Then the cond-expr clause is reevaluated and, depending on
the result, the loop either ends or another iteration occurs
int a = 1;
while(a<100)
{
a = a +1;
if(a<95)
continue;
ShowMessage(a);
}
Result, it will not show values between 1 and 94 because, remaining statements in the
current iteration are not executed after continue statement. Result will show values 95, 96,
96, 98, 99, 100 because of usage of continue with conditional statement as above.
331