xHarbour Reference Documentation > Command Reference xHarbour Developers Network  

LIST

Lists records of a work area to the console, file or printer.

Syntax

       LIST [<Expression,...>] ;
       [FOR  <lForCondition>] ;
     [WHILE  <lWhileCondition>] ;
      [NEXT  <nCount>] ;
    [RECORD  <nRecno>] ;
[TO PRINTER | TO FILE <cFilename>] ;
      [REST] ;
       [ALL] ;
       [OFF]

Arguments

<Expression>
An optional, comma separated list of expressions to display can be specified. If omitted, all fields of a record are output.
FOR <lForCondition>
This is a logical expression which is evaluated for all records in the current work area. Those records where <lForCondition> yields .T. (true) are displayed.
WHILE <lWhileCondition>
This is a logical expression indicating to continue processing records while the condition is true. The LIST command stops as soon as <lWhileCondition> yields .F. (false).
NEXT <nCount>
This option defines the number of records to display. It defaults to the current record. The NEXT <nCount> scope processes the next <nCount> records.
RECORD <nRecno>
If specified, only the record with the ID <nRecno> is displayed.
TO PRINTER
This option directs output to the printer. TO PRINTER and TO FILE are mutually exclusive options.
TO FILE <cFilename>
The output can be directed to a file with the name <cFileName>.
REST
This option lists the records beginning with the current record to the last record. If not specified, output begins with the first record.
ALL
The option ALL processes all records. It becomes the default scope when a FOR condition is specified.
OFF
If specified, this option suppresses the display of record numbers. By default, record numbers appear in the output.

Description

LIST is a database command displaying the results of a list of expressions to the console, a file or a printer. The command iterates the records in the current work area according to optional FOR and/or WHILE conditions, and the defined scope as specified with the ALL, NEXT, REST or RECORD options.

When records are marked for deletion, an asterisk (*) is output for deleted records when SET DELETED is set to OFF.

Info

See also:? | ??, DbEval(), DbList()
Category: Database commands , Output commands
Source:rdd\dblist.prg
LIB:xhb.lib
DLL:xhbdll.dll


Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe