Boolean

See Also: Declaring Variables, Variable Declaration Commands, Struct, Boolean Expressions

Purpose

Declares one or more Boolean variables.

Syntax

To declare Boolean variables

Boolean {identifier} [… {identifier}]

Where

To declare array variables of type Boolean

Boolean{dimension-list} {identifier} […{identifier}]

Where

What It Does

The Boolean command declares Boolean variables.

Multiple variables may be declared on one command line, with their names separated from each other by spaces.

Examples

Procedure Test

    Boolean bSmoker bMarried bEmployed

 

    Move False To bSmoker

    Move False To bMarried

    Move True  To bEmployed

End_Procedure  // Test

This example declares 3 Boolean variables: bSmoker, bMarried and bEmployed and initializes their values.

 

Boolean[] bPassFail

This example declares 1 dynamic array variable, named bPassFail, containing an undefined number of elements of type Boolean.

Boolean[5] bPassFail

This example declares 1 static array variable, named bPassFail, containing 5 of elements of type Boolean.

Boolean[][3] bPassFail

This example creates a two-dimensional dynamic array variable named bPassFail, containing an undefined number of elements of type Boolean. Conceptually, this represents a rectangular array with an undefined number of rows, each of 3 columns.

You can declare dynamic multi-dimensional arrays where all dimensions are dynamic; these are called jagged arrays.

Notes