Execute a command when a bar is highlighted
ON BAR <expN> OF <pop-up> [<command>]
The ON BAR command is used to specify commands which will execute when the specified bar is highlighted. A bar is a menu option in a Xbase style pop-up menu. These types of menus are created with the DEFINE POPUP and DEFINE BAR commands. The bar is identified by the numeric expression <expN> that was assigned with the DEFINE BAR command.
Used without a specified command, the ON BAR command disables previously specified commands. The command SET COMPATIBLE should be ON when using Xbase style menus. Commands specified by the ON POPUP command execute on highlighted bars that do not have an ON BAR command associated with them.
The pop-up menu is identified by the name <pop-up> that was assigned with the DEFINE POPUP command. The specified command may be any Recital/4GL command. To specify a command that will execute when a bar is selected, see the ON SELECTION BAR command.
define menu main define pad exit of main; prompt "\<Exit" at 0,0 define pad filelist of main; prompt "\<Files" at 0,6 on pad filelist of main activate popup files on selection pad exit of main deactivate menu define popup files from 1,06 define bar 1 of files prompt "\<Programs>" define bar 2 of files prompt "\<Databases" on bar 1 of files dialog box "Enter Bar 1" on bar 2 of files dialog box "Enter Bar 2" on exit bar 1 of files dialog box "Exit Bar 1" on exit bar 2 of files dialog box "Exit Bar 2" activate menu main