The following table is a set of statements and keywords that can be used in the script.
Type | Description |
| The |
| Statements for loop processes. |
| A |
| Executing different processes based on different conditions. |
| Terminates execution of the current iteration in a loop and then execute the next iteration in a loop. |
| Terminates the execution of a loop entirely. |
| Ends function execution and specifies a value to be returned to the function caller. |
|
|
Example for if
…else
:
if (A == 1) {
//run this instruction if A is equal to 1.
}
else if (A == 2) {
//run this instruction if A is equal to 2.
}
else {
//run this instruction if A does not equal 1 or 2.
}
Example forwhile
/do
…while
:
...
A = 0;
while (A < 10) {
A = A + 1;
//if A is less than 10, run this instruction, then add 1 to A.
//if A is equal to 10, end the while loop.
}
A = 0; While (A<10) { // Write the program that will be repeated. // while the WHILE keyword’s condition is True. // This example will be repeated 10 times. A = A +1; } |
...