Bill, that's elegant
Albert

On 1/16/2015 6:22 AM, Bill Downall wrote:

On Wed, Jan 14, 2015 at 2:14 PM, Dennis McGrath <[email protected] <mailto:[email protected]>> wrote:

    Razzak,

    That's cool.

    This is even better than the old MICRORIM_MENU_POS which could
    only capture one position.

    Saving the value list returned by the CHOOSE, we can use the
    INITVAL option to bring it back up later with all the previously
    selected values selected.


The first time I requested this was in R:BASE for Windows when it was still a Microrim product, not RBTI. I tried again recently, and voila, it's done!

Here's an example of how I am already using this. Dotted variables referenced in the CHOOSE command were looked up based on the menu being presented. (And, in fact, vSavedInitVal could be any of many variable names for different values of vMenuID).

SET VAR vSavedInitVal TEXT
IF vSavedInitVal IS NOT NULL THEN
SET VAR vInitOption = ('INITVAL' & .vSavedInitVal)
ELSE
SET VAR vInitOption = ('INITPOS 0')
ENDIF

SET VAR vMenuPick TEXT = NULL
CHOOSE vMenuPick +
FROM #VALUES FOR MenuText +
FROM AppMenuItems i1 +
WHERE i1.MenuID = .vMenuID +
AND i1.MenuActive = 1 +
ORDER BY MenuOrder +
TITLE .vMainTitle +
CAPTION .vSubTitle +
LINES .vNumChoices +
FORMATTED +
OPTION LIST_FONT_COLOR BLACK +
|LIST_BACK_COLOR SKY BLUE +
|LIST_FONT_NAME Arial +
|LIST_FONT_SIZE 18 +
|LIST_BOLD OFF +
|TITLE_FONT_COLOR WHITE +
|TITLE_BACK_COLOR TEAL +
|TITLE_FONT_NAME Arial +
|TITLE_FONT_SIZE 20 +
|TITLE_BOLD ON +
|WINDOW_BACK_COLOR TEAL +
|WINDOW_CAPTION SMALLINT +
|BUTTONS_BACK_COLOR WHITE +
  | &vInitOption

SET VAR vSavedInitVal = .vMenuPick


--
A democracy ..." can only exist until the majority discovers it can vote itself 
largess out of the public treasury."
Attributed to Alexander Fraser Tytler 1747-1813

Reply via email to