Informix Error -4374
-4374 This type of statement can only be used within a MENU statement.
This statement, for example a SHOW OPTION statement, only makes sense within the context of a MENU statement. Review the program in this vicinity to see if an END MENU statement has been misplaced. If you intended to set up the appearance of a menu before displaying it, use a BEFORE MENU block within the scope of the MENU.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-4374 fires when a statement such as SHOW OPTION is used outside a MENU statement's
context — per the official guidance, review the code for a possibly misplaced END MENU
statement; if setting up a menu's appearance before displaying it was intended, use a BEFORE MENU block within the MENU's scope.
- A menu-only statement used outside a
MENUstatement, per the official guidance — the direct, only cause. - A misplaced
END MENUstatement, per the official guidance — a related possible cause.
Solutions / Resolution
- Check for a misplaced
END MENUstatement, per the official guidance. - If pre-display setup was intended, use a
BEFORE MENUblock inside theMENU's scope, per the official guidance.
Examples
SHOW OPTION outside a MENU statement
FUNCTION setup()
SHOW OPTION 1
-- -4374: SHOW OPTION is only valid inside a MENU statement
END FUNCTION
Corrected
MENU "Options"
BEFORE MENU
SHOW OPTION 1
COMMAND "Save"
CALL save()
END MENU
Diagnostic Checks
- Check whether the flagged statement is inside a
MENUstatement's scope, and check for a misplacedEND MENUif it should be.
Related Errors / Related Topics
- -4314 — "The program cannot continue or exit a menu at this point because it is not
within a MENU statement." A related
MENU-scope error, aboutCONTINUE MENU/EXIT MENUspecifically rather than menu-only statements generally.
A menu-only statement is used outside a MENU statement — check for a misplaced END MENU,
or use BEFORE MENU for pre-display setup.