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.

If (A == 1)

{

    // A program for when A is 1

}

Else If (A == 2)

{

    // A program for when A is 2

}

Else

{

    // A program for when A is neither 1 nor 2- Statements for loop processes.FOR

Type

Description

if and else Statement

Evaluates ifelse is a condition statements. It evaluates the expression after if. If the expression is true, then the code immediately following "if" will be executed. Otherwise, the contents immediately following "else" will be executed. The user can specify multiple cases to evaluate by using the else-if expression.

while/do

while 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 statement for more complex loop processes.

SWITCH-CASE Statement

Statement for executing loop repeats until a specified condition becomes false.

switchcase Statement

Executing different processes based on different conditions.

GOTO continue Statement

A statement that forces the flow of the program to go to a specific location in the script.

CONTINUE Keyword

A keyword used in loop processes.

RETURN Keyword

A keyword that designates the value that will be returned to the caller.

RUNSCRIPT Keyword

A keyword that calls an external program.

(1) IF-ELSE Statement

The IF-ELSE statement is one of the most frequently used logical decision-making statements. It supports nested IF statements such as: If (condition 1) { If (condition 2) { … } }. There is no limit on the level of nested IF. The Else statement may be omitted. The ‘Else If’ statement is used for additional conditions following an If statement. For a given If-Else If-Else statement, only one branch will be executed. Once one condition is met, none of the following “Else If“ or “Else“ conditions are evaluated.

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.

if...else

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.

For example:

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.

}

 (2) WHILE/DO-WHILE Statement

...