Informix Error -1176
-1176 A COMMAND KEY value occurs elsewhere in the current menu.
In the indicated MENU statement, you defined a key value in more than one COMMAND KEY keylist or both in a COMMAND KEY keylist and as the default activation key for one or more nonhidden COMMAND clauses (for example, that key value is also the first character of one or more menu-option strings). This condition is illegal because MENU has no way to resolve what to do if the given keystroke occurs.
A given key might appear as the default activation key for more than one COMMAND (without the KEY clause) because the user will be prompted for subsequent keystrokes until a unique string is obtained. This action is not possible with COMMAND KEY because only one keystroke is compared.
If a COMMAND is currently hidden (by using the HIDE OPTION keywords), its default activation key is ignored and does not trigger this particular error condition.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-1176 fires when a key value is defined more than once within the same MENU statement — per
the official guidance, this happens either via the same key appearing in more than one COMMAND KEY keylist, or via a key appearing both in a COMMAND KEY keylist and as the default
activation key for a non-hidden COMMAND clause (its option string's first character). MENU
has no way to resolve which action to take if that keystroke occurs, so the condition is
disallowed outright.
- The same key value listed in more than one
COMMAND KEYkeylist within the sameMENUstatement, per the official guidance — the direct, first named cause. - A key value used in a
COMMAND KEYkeylist that also matches the default activation key (the first character of the option string) of a different, non-hiddenCOMMANDclause, per the official guidance — the direct, second named cause.
Solutions / Resolution
- Remove the duplicate key assignment, per the official guidance, so each key value maps to exactly one command in the menu.
- Check both explicit
COMMAND KEYkeylists and each non-hidden option's default (first- character) activation key for the conflict, since either source can collide with the other.
Examples
A key colliding with another option's default activation key
MENU "Orders"
COMMAND KEY ("v") "View" "View an order"
...
COMMAND "Void" "Void an order"
-- default activation key is "V" (first character), colliding with
-- the explicit COMMAND KEY ("v") above
...
END MENU
-- -1176: "v"/"V" is assigned via COMMAND KEY and also as Void's default key
Diagnostic Checks
- List every explicit
COMMAND KEYvalue and every non-hidden option's default (first- character) activation key in theMENUstatement, and check for any value appearing more than once.
Related Errors / Related Topics
- -1133 — "The NEXT OPTION name is not in the menu." A related menu-definition error, about an undeclared option name rather than a duplicate key assignment.
- -1168 — "Command does not appear in the menu." A related menu-reference error, about
SHOW/HIDE/NEXT OPTIONnaming an undeclared option.
A key value is assigned to more than one command in the same menu (via duplicate COMMAND KEY
entries, or a collision with a default activation key) — remove the duplicate assignment.