Previous Topic: &ZMNRDRET

Next Topic: &ZMODSRCID


&ZMODFLD

Returns the name of a modified variable.

&ZMODFLD is used to determine the names of variables modified by &PANEL, &NDBGET or &SETVARS.

Example: &ZMODFLD

&CONTROL FLDCTL
&PANEL NAMEADDR -* Issue panel requesting name and address
  :
.VALIDATE
   &GOTO .&ZMODFLD
                   -* jump to field validation routine
   &GOTO .NEXTPANE
.NAME              -* process name input
  &IF .&NAME = .&THEN ...             
  : 
.ADDR              -* process address input
 : 
&SETVARS PREFIX=K# KEYWORDS=(OPT,USER,FUNC) +
   MODFLD=YES PARMS ERROR=CONTINUE

Notes:

&ZMODFLD is processed as a stack. Each reference to &ZMODFLD returns the top element of the stack, until it is empty, and resets the MODFLD attribute of the returned field. &ASSIGN OPT=MODFLD with the NORESET option is used to access modified field names and still allow the subsequent use of the &ZMODFLD function.

When a panel is displayed, and the &CONTROL FLDCTL option is in force, NCL identifies all the fields on the panel which have been modified when the user causes input from the terminal. In addition, fields flagged as MODIFIED or ERRFLD by &ASSIGN OPT=SETMOD/SETERR before the panel display, or fields flagged by panel services field validation (when &CONTROL PANELRC is in effect) are also returned by the &ZMODFLD function.

For example, if a panel is displayed with ten input fields and the user changes three fields and presses Enter, successive references of &ZMODFLD return the names of the three modified fields.

The fields are returned in the order they appear on the screen, that is, they are processed on a left to right, top to bottom basis. This assists in the analysis and editing processes required in NCL procedures when handling multi-field input from terminals displaying NCL panels. Field validation is setup in an efficient manner to process only those fields modified rather than process all fields that exist on a panel.

The MODFLD attribute of a field is retained, unless cleared by &ZMODFLD, or by &ASSIGN OPT=MODFLD, or by a panel display. If a field still has a MODFLD attribute when a subsequent panel is displayed and it appears on that panel, then it is again treated as being modified by the user and appears in the &ZMODFLD stack. This is particularly useful when processing panels that contain selection lists. The user might enter several selections one of which is incorrect. The panel is redisplayed, highlighting the field in error. After the second display, the original correct selections can still be processed via &ZMODFLD.

The &SETVARS and &NDBGET statements also support the optional use of the MODFLD attribute.

More information:

&ASSIGN

&SETVARS

&NDBGET

&CONTROL