Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide To Clipper - <b>list</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
LIST


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

Purpose:    To sequentially access records in the current work area,
            displaying the results of one or more expressions for each
            record accessed.

Argument:   <exp list> is the list of expressions to be evaluated
            and displayed for each record processed.

Options:    Scope: The <scope> is the portion of the current
            database file to LIST.  The default is 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 record
            numbers.

            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 with each column separated by a space.  LIST
            is identical to DISPLAY with the exception that its default
            scope is ALL rather than NEXT 1.

Library:    CLIPPER.LIB


----------------------------------- Examples -------------------------------

   USE Sales
   LIST DATE(), TIME(), Branch
   LIST Branch, Salesman FOR Amount > 500 TO PRINT


   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
   SET CONSOLE OFF

   LIST Report() FOR Branch = "100"

   SET CONSOLE ON
   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 like the
   following example which terminates when you press Esc:

   USE Sales
   LIST Branch, Salesman, Amount WHILE INKEY() <> 27


See Also: DISPLAY

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson