Previous Topic: Testing for Global Map Input ConditionsNext Topic: Testing for Identical Data


Testing Cursor Position

This version of the #MAPINQ statement tests a specified map field for the presence of the cursor.

Syntax

►►─── #MAPINQ MRB=map-request-block-pointer ──────────────────────────────────►

 ►─┬─────────────────────────────────────────────┬────────────────────────────►
   └─ ,MRBLIST= ─┬─ MRBPLIST ◄ ─────────────────┬┘
                 └─ mrb-parameter-list-pointer ─┘

 ►─┬───────────────────────────┬──────────────────────────────────────────────►
   └─ ,CURSOR=cursor-position ─┘

 ►─┬──────────────────────┬───────────────────────────────────────────────────►
   └─ ,AID=aid-indicator ─┘
 ►─── ,FIELD=field-name ──────────────────────────────────────────────────────►

 ►─┬─────────────────────────┬────────────────────────────────────────────────►
   └─ ,INDEX=index-register ─┘

 ►─┬────────────────────────────────┬─────────────────────────────────────────►
   └─ ,INLEN=field-length-register ─┘

 ►─┬───────────────────────────────────────────┬──────────────────────────────►◄
   └─ ,IF=(CURSOR,cursor-at-this-field-label) ─┘

Parameters

MRB=

Specifies the storage area associated with the MRB of the map about which the inquiry is being made.

map-request-block-pointer

A register that points to the MRB area or the symbolic name of that area.

MRBLIST=

Specifies the location of the 20-fullword storage area that is substituted for the DC/UCF portion of SUBSCHEMA-CTRL:

MRBPLIST

(Default); is the symbolic name of the storage area that will be substituted for the DC/UCF portion of SUBSCHEMA-CTRL.

mrb-parameter-list-pointer

A register that points to the area or the symbolic name of the area.

CURSOR=

Requests that the system return the cursor address from the last map in operation to the specified location in the issuing program.

cursor-position

The symbolic name of a 2-byte user-defined field. The system will set the value of cursor-position to the row and the column, each a 1-byte binary number, of the cursor position on the screen.

AID=

Requests that the system return the AID to the specified location in the issuing program.

aid-indicator

The symbolic name of a 1-byte user-defined field that will be set to the 3270 AID character received in the last map in request.

FIELD=

Requests that the system move field-related information to the issuing program.

field-name

Specifies the name of the map field being tested.

Note: For each #MAPINQ request to test for cursor position, field-specific information can be requested for one map field; if information is needed for multiple fields, additional #MAPINQ commands must be issued.

INDEX=

Specifies the occurrence of the field if field-name is a multiply-occurring field.

index-register

Either a register or the symbolic name of a user-defined field that contains the subscript or an absolute expression.

INLEN=

Requests that the system return the entered length, in bytes, of the specified map field to the issuing program.

field-length-register

Either a register or the symbolic name of a halfword or fullword user-defined field to which the system will return the length.

IF=CURSOR,

Tests the outcome of the last map in request to determine whether the cursor was in the named field during the last map in operation.

cursor-at-this-field-label

Specifies the symbolic name of the routine within the issuing program to which the system will pass control if the cursor is in the named field during the last map in operation.

Example

The #MAPINQ statement shown below moves information about the EMPNUM field to the issuing task. The IF statement tests the outcome of the last map in request; if the cursor was in that field during the last map in operation, the system passes control to the routine labeled CURATNUM.

#MAPINQ MRB=BLOCK1,FIELD=EMPNUM,IF=(CURSOR,CURATNUM)