Difference between revisions of "LIST"

From Lianjapedia
Jump to: navigation, search
Line 25: Line 25:
 
If SET FILTER TO <condition> is in effect, only those records that satisfy the filter <condition> will be displayed.
 
If SET FILTER TO <condition> is in effect, only those records that satisfy the filter <condition> will be displayed.
  
{| class="wikitable" width=100%
+
{| class="wikitable" width="100%"
!width=30%|Keyword||Description
+
!width="30%"|Keyword||Description
 
|-
 
|-
|valign=top|<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.
+
|valign="top"|<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.
 
|-
 
|-
|valign=top|FOR <condition>||Only those records that satisfy the <condition> are displayed.
+
|valign="top"|FOR <condition>||Only those records that satisfy the <condition> are displayed.
 
|-
 
|-
|valign=top|OFF||Disables the display of the record number in the first column of the results.
+
|valign="top"|OFF||Disables the display of the record number in the first column of the results.
 
|-
 
|-
|valign=top|FIELDS <list>||Restricts the fields displayed to those specified.
+
|valign="top"|FIELDS <list>||Restricts the fields displayed to those specified.
 
|-
 
|-
|valign=top|HEADING||A heading corresponding to either the field names or the expression will be displayed above each column even if SET HEADING is OFF.
+
|valign="top"|HEADING||A heading corresponding to either the field names or the expression will be displayed above each column even if SET HEADING is OFF.
 
|-
 
|-
|valign=top|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.   
+
|valign="top"|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.   
 
|-
 
|-
|valign=top|WHILE <condition>||The [[SCOPE]] defaults to REST and records are displayed until the <condition> becomes false.
+
|valign="top"|WHILE <condition>||The [[SCOPE]] defaults to REST and records are displayed until the <condition> becomes false.
 
|-
 
|-
 
|}
 
|}

Revision as of 09:57, 5 February 2013

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>)]

[WHILE <condition>]

See Also

DIR, DISPLAY, Display and List, DISPLAY MEMORY, DISPLAY STATUS, DISPLAY STRUCTURE, SCOPE, SET FILTER SET RELATION

Description

The LIST command is a general purpose Lianja query command that retrieves and displays the contents of table files. The expressions that you specify can be any valid Lianja 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.

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.
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