Previous Topic: Testing for Global Map Input ConditionsNext Topic: Testing for Input Error Conditions


Testing for Cursor Position

This version of the INQUIRE MAP statement tests a specified map field for the presence of the cursor.

Syntax
►►─── INQUIRE MAP (map-name) ─────────────────────────────────────────────────►

 ►─── IF CURSOR AT DFLD (field-name) THEN imperative-statement;───────────────►◄
Parameters
MAP (map-name)

Specifies the map for which the inquiry is being made. Map-name is the 1- to 8-character name of a map that must correspond to a map name specified in the DECLARE MAP statement, as described in DML Precompiler-Directive Statements.

IF CURSOR AT DFLD (field-name)

Determines whether the cursor was in the named map field during the last map input operation. Field-name identifies the field within the named map to be tested.

THEN imperative-statement

Specifies the action to be taken when the test condition is true. Imperative-statement can be a single PL/I statement, a DML statement, or a nested block of PL/I and DML statements.

Example

The following example illustrates an INQUIRE MAP statement that tests for the presence of the cursor in the PASSED_DATA_01 data field; if the cursor is present in this field, the CHECK_2 routine is performed:

INQUIRE MAP (EMPMAPLR)
   IF CURSOR AT DFLD (EMP_LAST_NAME_0415)
     THEN CALL CHECK_2;