Statement types and keywords

Table of Contents

Previous | Top | Next

The types and keywords used by the pseudocode editor are described in the table below.

Type

Keyword

Description

Assignment operation.

N/A

Represents non-composite statements such as variable declarations or assignments.

Sub Procedure

Call

A special type of assignment statement that represents a call to another procedure.

If statement

If

If a condition is true then the contained code is executed.

Else if statement

Else if

If the main if condition is false but this condition is true then the contained code is executed.

Else statement

Else

If the main if condition and any else if conditions are false then the contained code is executed.

Try statement

Try

The contained code is executed until an exception is encountered.

Catch statement

Catch

When the associated exception is thrown, it is caught and the contained code is executed.

Finally statement

Finally

The contained code is executed whether or not an exception was thrown. Typically used to ensure that resources are cleaned up properly.

Switch statement

Switch

Inspects a value and directs control to the contained case or default statement.

Select statement

Select

The same as the switch statement but more familiar to users of Visual Basic. The two are interchangeable.

Case statement

Case

In a switch or select statement, control will be directed to the case statement when the associated value is detected. The contained code is then executed.

Default statement

Default

If there is no matching case statement in a switch or select statement then the code inside the default statement will be executed.

For statement

For

Loops for a given number of iterations and executes the contained code.

Foreach statement

Foreach

Loops through a collection of a given type and executes the contained code.

While statement

While

Loops while a condition is true and executes the contained code.

Repeat until statement

Repeat

Loops until the condition is true and executes the contained code.

Do while statement

Do while

Loops while the condition is true and executes the contained code.