Versions Compared

Key

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

...

Type

Description

IF-ELSE Statement

One of the most frequently used logical decision-making statementsEvaluates 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.

WHILE/DO-WHILE Statement

Statements for the loop processprocesses.

FOR Statement

More complex but useful for A statement for more complex loop processes.

SWITCH-CASE Statement

Statement for the executing different processes according to the several casesbased on different conditions.

GOTO Statement

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

CONTINUE Keyword

A keyword used in the loop processprocesses.

RETURN Keyword

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

RUNSCRIPT Keyword

A keyword that calls the 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-ELSE IF-ELSE IF…. There is no limit on the level of nested IF. The Else statement may be omitted. The Else If statement is used for additional possible 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 other conditions are evaluated.

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 not neither 1 nor 2

}

 (2) WHILE/DO-WHILE Statement

...