DIALOG QUERY

From Recital Documentation Wiki
Jump to: navigation, search

Purpose

Display a query dialog for interactive query creation


Syntax

DIALOG QUERY [LOCK]


See Also

DIALOG FIELDS, DIALOG GET, DIALOG SCOPE, FIND, FOUND(), Function Keys, LASTKEY(), MENU FIELDS, MENUITEM(), MENU QUERY, MENU SCOPE, SEEK, SET COLOR, SET COLOR OF, SET DIALOG, SET SHADOW


Description

The DIALOG QUERY command displays a dialog used for performing queries on the active table. If the active table is indexes, the dialog will contain two prompts, one labeled KEY and the other labeled WHERE. If the table is not indexed, on the WHERE prompt is displayed. The screen is automatically saved and restored when DIALOG QUERY is used.

The SET COLOR and SET COLOR OF DIALOGFRAME commands may be used to specify the colors for the dialog box and frame.

If the LOCK clause is present, the located record will be placed into update mode if a lock can be placed.

To specify a search key for the master index, place the cursor on the KEY field and enter in the value followed by the [RETURN] key.

To specify a WHERE condition, place the cursor on the WHERE field and enter in the boolean condition. The [HELP] key can be pressed for popup query menus allowing the query to be constructed through menu selections (see MENU QUERY for more information). The menus contain choice lists of fields, operators and connectors. If an invalid query condition is entered in the WHERE field, and error message will be displayed on exit from the DIALOG QUERY.

There are four dialog buttons in the DIALOG QUERY: "OK", "CANCEL", "LOAD" and "SAVE". A dialog button can be selected by moving the cursor onto the desired button and pressing the [RETURN] key. The [CURSOR UP] key moves the cursor back into the DIALOG QUERY to change the existing query. The [ABANDON] and [EXIT/SAVE] keys many also be used to exit from the DIALOG QUERY.

If the "SAVE" button is selected, then the SAVE QUERY dialog is displayed, containing two input fields. The file name for the query to be saved must be entered into the FILE field. A descriptive name for the file can be entered into the TITLE field. If the [EXIT/SAVE] key is pressed or the "OK" button is selected, then the query will be saved with a '.qry' extension.

If the "LOAD" button is selected, the LOAD QUERY dialog is displayed, containing a list of available queries. The previously saved query files are displayed along with their titles. The [PAGE UP], [PAGE DOWN] and cursor keys can be used to navigate the list. The [RETURN] key is used to select the highlighted query. The "OK" and "CANCEL" buttons are then selectable. If "OK" is selected, the query is loaded into the main dialog for selection or modification.

On exit from the DIALOG QUERY, the query will be performed and the record pointer moved to the located record if the query is successful. If the query fails, the record pointer remains at its original position. If the query is successful, the LASTKEY() function will return 89 (ASCII "Y").


Example

use patrons index names, events
dialog query
if lastkey() = 89
    edit
endif


Products

Recital