Previous Topic: &$MHOPT=SELECT Statement

Next Topic: &$MHOPT=EXIT Statement


&$MHOPT=RETURN Statement

This statement indicates that the action for a selected menu option has completed. When the value of &$MHOPT is RETURN, you can use the menu service procedure to perform any special processing that is required on the completion of the action.

Read-Only Variables

This statement contains the following read-only variables:

&$MHOPT

The variable is set to RETURN.

&$MHAPPLID

This variable is set to the ID of the application to which the menu belongs.

&$MHMENUNUM

This variable is set to the menu number.

&$MHSELECT

This variable is set to the menu option for which the action has completed.

Modifiable Variables

This statement contains the following modifiable variables:

&SYSMSG

Use this variable to return a message. If an error occurs during special processing, this variable must be set to an error message.

Return Codes

The variable &RETCODE must be set by the menu service procedure to one of the following return codes:

0

Proceed; display the menu

1

Terminate the menu and return to the previous primary menu

4

If &SYSMSG is set, redisplay the menu with the value of &SYSMSG as the error message; if &SYSMSG is not set, terminate the menu and return to the previous primary menu

All other return codes are treated as errors, and &SYSMSG must be set. The menu is redisplayed with the value of &SYSMSG as the error message.