Flags


ANSI

 

Program execution may be governed by certain indicators or Flags. These Flags may be set or not set (FALSE). There are three types of Flags: Condition, Pseudo Condition and Function.

Condition Flags

Four Condition Flags are available: EQUAL (or ZERO), LESS, OVER and EOS. The EQUAL (or ZERO) Flag indicates a test has matched or a mathematical instruction has generated a ZERO result. The LESS Flag may be used for testing relative sizes or values in a less than (<) fashion. However, the OVER Flag is not a greater than (>) evaluation. The EOS (End Of String) Flag determines when manipulation of a character string has reached certain limitations. These Flags are set to TRUE or FALSE as the result of certain instructions, described further in this chapter.

Pseudo Condition Flags

There is one Pseudo Condition Flag: the GREATER Flag. While not actually a Condition Flag, it has been included to ease programming. The TRUE condition of the GREATER Flag signifies that both the LESS and EQUAL (or ZERO) Flags are FALSE, while a FALSE GREATER Flag signifies that one or both of them are TRUE. Therefore, it may be used for greater than (>) testing.

Function Flags

There are also flags associated with forty Function Keys and eleven other Control Keys (Function Flags), and an all encompassing FKEY Flag. Though all of the following Function Flags are supported by the compiler, their support within a specific program or application may be limited by the terminal or system in use. All of the Function Flags, including the FKEY Flag, are cleared at the beginning of each KEYIN instruction. The appropriate Function Flag is set whenever a supported Function or Control Key is entered at the terminal. The FKEY Flag is also set when any of the Function Flags is set. Only one of the Function Flags may be set at a time since it is cleared once it has been tested and is TRUE or upon occurrence of another KEYIN. The FKEY Flag determines if any Function Flag has been set. Any test of the FKEY Flag clears all function key flags.

 

The Function Flags are as follows:

 

Flag

Set when ...

FKEY

any of the following are depressed.

Fnn

`nn' corresponds to function keys 1 to 40.

UP

the UP arrow key was depressed.

DOWN

the DOWN arrow key was depressed.

LEFT

the LEFT arrow key was depressed.

RIGHT

the RIGHT arrow key was depressed

INS

the INSert key was depressed.

DEL

the DELete key was depressed.

PGUP

the PAGE UP key was depressed.

PGDN

the PAGE DOWN key was depressed.

HOME

the HOME key was depressed.

END

the END key was depressed.

ESC

the ESCAPE key was depressed.

ESCAPE

the ESCAPE key was depressed.

TAB

the TAB key was depressed.

BACKTAB

the Shifted TAB key was depressed.

EVENT

an object event has occurred (PLBCMP GUI environment only)

 

See Also: Program Control Instructions

 



PL/B Language Reference Expressions Functions