[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
LIST

    To LIST the result of one or more expressions for each record
    processed.

Syntax

    LIST [OFF] [<scope>] <exp list> [FOR <condition>]
    [WHILE <condition>] [TO PRINT] [TO FILE <file>/(<expC>)]

Argument

    <exp list> is the list of values displayed for each record processed.

Options

    Scope: The <scope> is the portion of the current database file to
    LIST.  The default is the current record.  If a condition is specified
    the scope becomes ALL.

    Condition: The FOR clause specifies the conditional set of records
    to LIST within the given scope.  The WHILE clause specifies the set of
    records meeting the condition from the current record until the
    condition fails.

    Off: The OFF clause suppresses the display of the record number.

    Print: The TO PRINT clause echoes output to the printer.

    File: The TO FILE clause echoes output to the specified filename.
    If an extension is not specified, (.txt) is added.

Usage

    LIST sends the results of the <exp list> to the screen in a tabular
    format, each column separated by a space.  LIST is identical to DISPLAY
    with the exception that its default scope is ALL rather than NEXT 1.

Examples

    One of the unique uses for LIST in Clipper is to provide the record
    movement, scope, condition, and end-of-file boundary tests for a
    procedure that traverses a database file.  The procedure itself only
    processes the current record.  In the example below, Report() operates
    only on the current record:

    USE Sales                         
    SET DEVICE TO PRINT               
    LIST Report() FOR Branch = "100"  
    SET DEVICE TO SCREEN              
                                      
    FUNCTION Report                   
    @ PROW() + 1, 3 SAY Branch        
    @ PROW() + 1, COL() + 1 SAY Branch
    @ PROW() + 1, COL() + 1 SAY Amount
    RETURN ""                         

    To interrupt a LIST, use INKEY() as a part of the condition such as:

    DISPLAY Branch, Salesman, Amount FOR INKEY() <> 27

See Also: DISPLAY
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson