@NEXT_ITEM

Type/Length:    INT, 3   
Modifiable: Yes  

@NEXT_ITEM can be read to determine the current menu item.  @NEXT_ITEM can also be set to move the cursor to a specified item upon return from an item's trigger.

ASSIGNMENT

A value can be assigned to this system field in a performed trigger for a MENU item.  When a value is assigned to this system field, the cursor will move to the corresponding menu item.  @NEXT_ITEM is set to a number that corresponds to the menu ITEM to position the cursor.

The order of ITEM statements within the LAYOUT SCREEN definition is significant.  The MENU statement /command processes the ITEM statements in the order in which they are defined, not in the order that they appear on the screen.  If the selected item is the second ITEM statement in the LAYOUT SCREEN definition, the value of @NEXT_ITEM is 2.

The Screen Management Facility (SMF) sets @NEXT_ITEM to the number of the current item just before a performed trigger is executed.  When @NEXT_ITEM is set, a value must be supplied that is different from the current value and is in the proper range.  Otherwise, @NEXT_ITEM is ignored and no error indication is given.

This system field cannot be used to reprocess the same menu item.  The way to reprocess the same item is to set @MENU_ACTION to "REDO".

SMF does not act upon @NEXT_ITEM upon return from a HELP trigger but it is set to the current item before executing the HELP trigger.

RETURNS

Another way to use @NEXT_ITEM is to detect the menu item where the cursor is positioned.  @NEXT_ITEM is like the system field @MENU_CHOICE in this respect, except that @NEXT_ITEM can be used with forms or menus.

SEE ALSO:  MENU Statement/Command (earlier in this section).

@Menu_Keyword    @Function_Code