Difference between revisions of "LIST"
Helengeorge (Talk | contribs) (→Class) |
Yvonnemilne (Talk | contribs) |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | |||
− | |||
==Purpose== | ==Purpose== | ||
List the contents of the active table and any related tables | List the contents of the active table and any related tables | ||
Line 22: | Line 20: | ||
==See Also== | ==See Also== | ||
− | [[CREATE REPORT]], [[DB_PRINT]], [[DIR]], [[DISPLAY]], [[DISPLAY MEMORY]], [[DISPLAY STATUS]], [[DISPLAY STRUCTURE]], [[Function Keys]], [[REPORT]], [[SET DESCRIPTIONS]], [[SET FILTER]], [[SET HEADING]], [[SET PAGELENGTH]], [[SET PAGEWIDTH]], [[SET PRINTER]], [[SET RELATION]] | + | [[CREATE REPORT]], [[DB_PRINT]], [[DIR]], [[DISPLAY]], [[Display and List]], [[DISPLAY MEMORY]], [[DISPLAY STATUS]], [[DISPLAY STRUCTURE]], [[Function Keys]], [[REPORT]], [[SCOPE]], [[SET DESCRIPTIONS]], [[SET FILTER]], [[SET HEADING]], [[SET PAGELENGTH]], [[SET PAGEWIDTH]], [[SET PRINTER]], [[SET RELATION]] |
Line 28: | Line 26: | ||
The LIST command is a general purpose Recital/4GL query command that retrieves and displays the contents of table files on the screen. The LIST command scrolls continuously unless halted by the [HOLD SCREEN] key, thereby differing from DISPLAY commands, which pause every 17 lines until a key is pressed. When displaying a record that is longer than the screen width, the contents to the right of the display normally will not be displayed unless you have set your terminal to wrap. Consult the relevant manual for your terminal regarding this feature. | The LIST command is a general purpose Recital/4GL query command that retrieves and displays the contents of table files on the screen. The LIST command scrolls continuously unless halted by the [HOLD SCREEN] key, thereby differing from DISPLAY commands, which pause every 17 lines until a key is pressed. When displaying a record that is longer than the screen width, the contents to the right of the display normally will not be displayed unless you have set your terminal to wrap. Consult the relevant manual for your terminal regarding this feature. | ||
− | LIST is more powerful than it looks initially. The expressions that you specify can be any valid Recital | + | LIST is more powerful than it looks initially. The expressions that you specify can be any valid Recital expression, including the use of alias pointers into other workareas. If you have SET RELATION TO another table, for each record that is read from the active table, the related table will have its record pointer positioned, and the appropriate record read into its workarea. |
If SET FILTER TO <condition> is in effect, only those records that satisfy the filter <condition> will be displayed. If SET DESCRIPTIONS and SET HEADING are both ON and the FIELDS clause is specified, the field descriptions will be used as the column headings rather than the field names. The command SET HEADING TO SINGLE | DOUBLE | NONE controls the underlining of the column headings. | If SET FILTER TO <condition> is in effect, only those records that satisfy the filter <condition> will be displayed. If SET DESCRIPTIONS and SET HEADING are both ON and the FIELDS clause is specified, the field descriptions will be used as the column headings rather than the field names. The command SET HEADING TO SINGLE | DOUBLE | NONE controls the underlining of the column headings. | ||
Line 36: | Line 34: | ||
!Keyword||Description | !Keyword||Description | ||
|- | |- | ||
− | |<scope>||If the | + | |<scope>||If the [[SCOPE]] is not specified, all records will be displayed, unless the WHILE clause is used, in which case it will default to REST. |
|- | |- | ||
|FOR <condition>||Only those records that satisfy the <condition> are displayed. | |FOR <condition>||Only those records that satisfy the <condition> are displayed. | ||
Line 50: | Line 48: | ||
|TO PRINT||The display output will be sent to a printer. The TO PRINT option will default to a local printer unless the command SET PRINTER TO \\SPOOLER is issued. The print request will then be spooled to the system printer, which is defined by the environment variable DB_PRINT. | |TO PRINT||The display output will be sent to a printer. The TO PRINT option will default to a local printer unless the command SET PRINTER TO \\SPOOLER is issued. The print request will then be spooled to the system printer, which is defined by the environment variable DB_PRINT. | ||
|- | |- | ||
− | |WHILE <condition>||The | + | |WHILE <condition>||The [[SCOPE]] defaults to REST and records are displayed until the <condition> becomes false. |
|- | |- | ||
|} | |} | ||
Line 57: | Line 55: | ||
==Example== | ==Example== | ||
<code lang="recital"> | <code lang="recital"> | ||
− | use | + | open database southwind |
− | + | use products order categoryid | |
− | seek | + | seek 2 |
− | list | + | list productid, productname while categoryid = 2 |
</code> | </code> | ||
− | |||
==Products== | ==Products== | ||
− | Recital | + | Recital Server, Recital |
[[Category:Documentation]] | [[Category:Documentation]] | ||
[[Category:Commands]] | [[Category:Commands]] | ||
[[Category:Table Basics]] | [[Category:Table Basics]] | ||
[[Category:Table Basics Commands]] | [[Category:Table Basics Commands]] |
Latest revision as of 16:05, 3 September 2010
Purpose
List the contents of the active table and any related tables
Syntax
LIST [<scope>]
[FIELDS <field list>|<exp list>]
[FOR <condition>]
[HEADING]
[OFF]
[TO FILE <.txt filename> | (<expC>)] | [TO PRINT]
[WHILE <condition>]
See Also
CREATE REPORT, DB_PRINT, DIR, DISPLAY, Display and List, DISPLAY MEMORY, DISPLAY STATUS, DISPLAY STRUCTURE, Function Keys, REPORT, SCOPE, SET DESCRIPTIONS, SET FILTER, SET HEADING, SET PAGELENGTH, SET PAGEWIDTH, SET PRINTER, SET RELATION
Description
The LIST command is a general purpose Recital/4GL query command that retrieves and displays the contents of table files on the screen. The LIST command scrolls continuously unless halted by the [HOLD SCREEN] key, thereby differing from DISPLAY commands, which pause every 17 lines until a key is pressed. When displaying a record that is longer than the screen width, the contents to the right of the display normally will not be displayed unless you have set your terminal to wrap. Consult the relevant manual for your terminal regarding this feature.
LIST is more powerful than it looks initially. The expressions that you specify can be any valid Recital expression, including the use of alias pointers into other workareas. If you have SET RELATION TO another table, for each record that is read from the active table, the related table will have its record pointer positioned, and the appropriate record read into its workarea.
If SET FILTER TO <condition> is in effect, only those records that satisfy the filter <condition> will be displayed. If SET DESCRIPTIONS and SET HEADING are both ON and the FIELDS clause is specified, the field descriptions will be used as the column headings rather than the field names. The command SET HEADING TO SINGLE | DOUBLE | NONE controls the underlining of the column headings.
Keyword | Description |
---|---|
<scope> | If the SCOPE is not specified, all records will be displayed, unless the WHILE clause is used, in which case it will default to REST. |
FOR <condition> | Only those records that satisfy the <condition> are displayed. |
OFF | Disables the display of the record number in the first column of the results. |
FIELDS <list> | Restricts the fields displayed to those specified. |
HEADING | A heading corresponding to either the field names or the expression will be displayed above each column even if SET HEADING is OFF. |
TO <file> | The display output will be sent to the specified file. The filename can be substituted with a <expC>, enclosed in round brackets, which returns a valid filename. If no file extension is specified, then ".txt" will be used. The command SET PAGELENGTH governs the output file pagination and SET PAGEWIDTH defines the width of each page. Page numbers are centered on the bottom of the page according to width. |
TO PRINT | The display output will be sent to a printer. The TO PRINT option will default to a local printer unless the command SET PRINTER TO \\SPOOLER is issued. The print request will then be spooled to the system printer, which is defined by the environment variable DB_PRINT. |
WHILE <condition> | The SCOPE defaults to REST and records are displayed until the <condition> becomes false. |
Example
open database southwind use products order categoryid seek 2 list productid, productname while categoryid = 2
Products
Recital Server, Recital