<<

Contents

Search

>>

 

CASE

 

 

Instruction

 

 

Syntax:

CASE <AUSDRUCK>

OF <AUSDRUCK> ... Instructions ...

[OF <AUSDRUCK> ... Instructions ...]...

[OFREST ... Instructions ...]

ENDCASE

 

Meaning:

Multiple selection statement.

 

The statement behind CASE is compared with every statement behind OF. If the statements are identical, the respective instructions are executed and program execution continues at the end of the block (ENDCASE). If they are not identical, the instructions from the OFREST branch are executed – if this branch exists – otherwise no instruction is executed. If several values of statements are identical in the Of branches, only the instructions of the first found OF branch are executed if the statements are identical. The statements behind CASE, OF and OFREST must each be of the same type, that is either numeric or alphanumeric.

Sample:

CASE EBUS_GR_MENUE$

  OF "Master Data Management"  CALL #5

  OF "Reports"                 CALL #10

  OF "Exit"                    EXIT

ENDCASE

 

See also:

IF