""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
ADD MENU BLOCKS TO CUSTOM OR MACRO ACTIONS
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
PRODUCT : R:BASE VERSION : 3.1
CATEGORY : PROGRAMMING SUBCATEGORY : TOOLS
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
It's easy to add a menu block to a custom or macro action in an
Application EXPRESS application. Just add the menu blocks at the end
of the code. For example, the following code uses two menu blocks
(SELMEN and SRTMEN):
WRITE ' Choose columns to view: '+
AT 8,7 black ON cyan
CHOOSE vselcol FROM selmen +
IN mine.apx AT 10,10 CLEAR
WRITE ' Choose columns to sort by: ' +
AT 8,7 black ON cyan
CHOOSE vsrtcol FROM srtmen +
IN mine.apx AT 10,10 CLEAR
CLS
SELECT &vselcol FROM transmaster +
ORDER BY &vsrtcol
PAUSE red
$MENU
selmen
CHKBOX
|#COLUMNS IN transmaster|
$MENU
srtmen
CHKSORT
|#COLUMNS IN transmaster|
For this code to work correctly, the user must choose at least one
column to view and one column to sort by.
When you create a "custom" action that contains a menu block, don't
press [Enter] on the last menu option or you'll add an extra line to
the end of the menu block; press [F2] instead. When there's a blank
line at the bottom of a menu block, Application EXPRESS drops
everything that lies below the blank line in the .APP file when it
saves the application.
When you modify an existing application, Application EXPRESS adds a
blank line to the end of a custom when reading the application in,
thus causing this error when it saves the application even if the
custom containing the menu block wasn't edited. Therefore, you'll need
to edit the custom to remove the blank line before you save it.