Difference between revisions of "MENU BROWSE"

From Recital Documentation Wiki
Jump to: navigation, search
(Class)
Line 1: Line 1:
==Class==
 
Menus
 
  
  

Revision as of 15:26, 23 October 2009


Purpose

Provide a selection menu from the contents of one or more tables


Syntax

MENU BROWSE <expC1>

[AT <expN1>,<expN2> TO <expN3>,<expN4>]

[BOLD]

[CLEAR]

[COMMAND <expC4>]

[FOR <condition>]

[LABEL <expC2>]

[OFF]

[POPUP]

[QUIT]

[SELECT <expC3>]

[WHILE <condition>]


See Also

@...GET, ASTORE(), CREATE, FIND, Function Keys, LOCATE, MENU(), MENUITEM(), SEEK


Description

The MENU BROWSE command provides a selection menu from the contents of one or more tables. You can browse on any character expression, <expC1>, against records in the currently selected workarea or related workareas.

Files and relationships are also satisfied during the BROWSE. The [PAGE UP],[PAGE DOWN], and the [CURSOR] keys can be used to move about in the menu. The table is browsed from its current position, so you must issue a GOTO TOP if you want to browse the entire table, or alternatively you could use SEEK to position to a specific record. If the target table for a MENU BROWSE is indexed, then pressing the [FIND] key results in a SEEK being performed rather than a sequential (LOCATE) search.

AT <expN1>,<expN2> TO <expN3>,<expN4>

The menu may be optionally positioned with at the specified row and coordinates, otherwise the menu is centered on the screen.


Keyword Description
BOLD The menu frame is highlighted.
CLEAR The inside of the menu frame is cleared before displaying the menu.
COMMAND <expC4> The command <expC4> and all selections made from the menu are displayed in the action line (line 22).
FOR <condition> Only the records that satisfy the <condition> criteria are retrieved from the tables.
LABEL <expC2> The specified character string <expC2> is displayed at the top of the menu frame.
OFF The display of messages in the message line is disabled.
POPUP The screen is automatically saved when the menu is displayed, and restored when the menu is cleared.
QUIT When the QUIT option is specified, the [ABANDON] key exits the menu.
SELECT <expC3> Multiple selections can be made. The MENUITEM() function can be used to return a string containing the selections made, each separated with <expC3>. Selections are made by placing the cursor on the required menu item and pressing the [RETURN] key. Once all the required selections have been made, the [EXIT/SAVE] key is used to save them or the [ABANDON] key will cancel them. The ASTORE() function can be used to place all the selections into separate array items.
WHILE <condition> Records are retrieved while the <condition> is true. The record pointer should be positioned on a record matching the condition before issuing the MENU BROWSE.


The user can move to choices in the menu using the [DOWN ARROW] or [UP ARROW] keys to highlight the choice, or by typing the letters of the search string. As each letter is typed the highlight bar is moved to the first choice matching the typed letters. To reset the buffer, press {CTRL} and {Y} simultaneously.

Pop-up choice lists which use MENU BROWSE can be defined globally in the Applications Data Dictionary (see CREATE), or by using the CHOICELIST clause with the @…GET command. Choice lists may also be associated with @…GETS at the forms level as part of a validation procedure.

The MENU() function, when used with the MENU BROWSE command, returns the record number of the selected record. The MENUITEM() function returns the text of the selected menu item line. The length of the returned menu item is the total length of the concatenated fields in <expC1>, or the width of the menu as specified in the <row, col> coordinates. MENU BROWSE does not cause the record pointer to move to the selected record.


Example

// Menu browse wp files
procedure menu-browse
  if filecount("*."+m_filetype) = 0
      dialog box "No files in this directory.  Press any key to continue."
  else
      go top
      set message to "Select file required.;
        Press ^K to Find or ^G to Abandon."
      menu browse file + descript + who_c + ;
        dtoc(date_c) + "" + who_m + dtoc(date_m);
        at 3,0 to 18,79; label "File Name;
        Description--------------" + ;
        "Created by----Date----Modified by--Date---":
        clear;
        bold;
        quit
      if not empty(menuitem())
          m_file=left(menuitem(),10)
          seek m->m_file
      endif
  endif
return


Products

Recital Mirage Server, Recital Terminal Developer