Previous Topic: &ZCONSOLE

Next Topic: &ZDBCS


&ZCURSFLD

Indicates the field location and the offset within that field where the cursor is positioned.

These two system variables is used to determine the field and offset within the field where the cursor is positioned as at the last operator input from a panel displayed using the &PANEL statement.

&ZCURSFLD is set to the field location of the cursor. &ZCURSFLD is useful for providing context sensitive help. It contains the name of the field the cursor is in (TYPE=INPUT and TYPE=OUTVAR fields only—output fields have no name).

&ZCURSPOS is set to the offset within the field where the cursor is positioned.

Example: &ZCURSFLD

.HELP
&IF .&ZCURSFLD EQ .COMMAND &THEN +
   &GOTO .CMDHELP
   .
   .-* General Help
   .
.CMDHELP
  .
  .-* Help for the command field
  .
-* Split the line at the cursor position
&IF .&ZCURSPOS NE . &THEN +
   &PARSE SEGMENT VARS=(PREFIX(&ZCURSPOS),SUFFIX) +
      DATA=&
&ZCURSFLD 
-* &PREFIX contains the data up to the cursor position 
-* &SUFFIX contains the data after the cursor position

Note: &ZCURSFLD and &ZCURSPOS are set only when &CONTROL FLDCTL is set on. Otherwise, both are null.