IF SELECTION
[NOT UNIQUE [IN [FIELDS ]]] operand1
|
[THEN ]
statement
|
[ELSE
statement]
|
END-IF |
IF SELECTION [NOT
UNIQUE [IN [FIELDS ]]] operand1
|
|||||
[THEN ]
|
statement | ||||
DO
statement
DOEND
|
|||||
ELSE
|
statement | ||||
DO
statement
DOEND
|
This document covers the following topics:
For an explanation of the symbols used in the syntax diagram, see Syntax Symbols.
Related Statements: DECIDE FOR | DECIDE ON | IF
Belongs to Function Group: Processing of Logical Conditions
The IF SELECTION
statement is used to verify that in a
sequence of alphanumeric fields one and only one contains a value.
Operand Definition Table:
Operand | Possible Structure | Possible Formats | Referencing Permitted | Dynamic Definition | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
operand1 | S | A | A | U | L | C | yes | no |
Syntax Element Description:
operand1 |
Selection Field:
As operand1 you specify the fields which are to be checked. If you specify an attribute control variable (Format C), it is
considered to contain a value if its status has been changed to
Note: |
---|---|
THEN statement |
Statement(s) to be Executed:
The statement(s) specified in the
This statement is generally used to verify that a terminal user has
entered only one function in response to a map displayed via an
Note: |
ELSE statement | In the ELSE clause, you specify the
statement(s) to be executed if exactly one field contains a value.
|
END-IF | The Natural reserved word END-IF must be used to
end the IF SELECTION statement.
|
** Example 'IFSEL': IF SELECTION ************************************************************************ DEFINE DATA LOCAL 1 #A (A1) 1 #B (A1) END-DEFINE * INPUT 'Select one function:' // 9X 'Function A:' #A 9X 'Function B:' #B * IF SELECTION NOT UNIQUE #A #B REINPUT 'Please enter one function only.' END-IF * IF #A NE ' ' WRITE 'Function A selected.' END-IF IF #B NE ' ' WRITE 'Function B selected.' END-IF * END
Select one function: Function A: Function B:
Page 1 05-01-17 11:04:07 Function A selected.