Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The following table is a set of statements and keywords that can be used in the script.

Type

Description

ifelse Statement

The if statement executes the instruction code when the condition is true. Otherwise, the else statement will execute its instruction code. if...else statements can be nested inside of another if...else statement using the else if statement. Please note that there is no limitation on how many else if can be nested inside of if...else.

while/dowhile Statement

Statements for loop processes. while loop expression will continue to execute until the expression becomes false. As for the dowhile loop, do instruction code will always be executed at least once before while expression is evaluated. The loop will repeat until while expression becomes false.

for Statement

A for loop repeats until a specified condition becomes false.

switchcase Statement

Executing different processes based on different conditions.

continue Statement

Terminates execution of the current iteration in a loop and then execute the next iteration in a loop.

break Statement

Terminates the execution of a loop entirely.

return Function

Ends function execution and specifies a value to be returned to the function caller.

runScript() Function

runScript() is used to call another script program. For example, if runScript() is being used in script name "A" to call a script name "B", as soon as script A executes, script B will execute as well.

Example for ifelse:

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/dowhile:

...

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;

}

...