Search code examples
informix4gl

Use multiple letters for shortcut on command key in informix 4GL


I have the following 2 RingMenus:

  1. AddOrder
  2. AddCustomer

How can I add a shortcut so that I can press "AO" for AddOrder, and "AC" for AddCustomer?

I know we can add shortcuts like:

command key("o") "AddOrder" "Add a new order"

But how can I make the shortcut to be more than one character?

I am looking for something like this:

command key("ac") "AddCustomer" "Add a new customer"
command key("ao") "AddOrder" "Add a new order"

But with the above line I'm getting the following error:

"ac" is not a recognized key value. See error number -4447.

Oh, and by the way:

Message number -4447 not found.


Solution

  • Succinctly, you can't. Menu keys are a single character.

    IIRC, you could experiment with COMMAND 'ACustomer' and COMMAND 'AOrder'. The ambiguous first letters mean a 'menu resolution method' is used after you've typed the opening a, so you'd have to type C or O (in either upper-case or lower-case) to select the menu option. You need to keep typing the common leading letters, so 'Add Customer' and 'Add Order' would require a, d, d, before choosing c or o.

    On the whole, though, it is simpler and arguably better to strict to unique initial letters for the options in the menu commands.