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>sort</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
SORT


Syntax:     SORT [<scope>] ON <field1> [/A][/C][/D] [,<field2>
            [/A][/C][/D]]... TO <file>/(<expC>) [FOR <condition>]
            [WHILE <condition>]

Purpose:    To copy records from the current work area to another
            database file in sorted order.

Arguments:  <field1...fieldN> are the fields to use as sort keys.
            Note that SORT does not work with substrings or expressions
            as keys.

            <file> is the name of the target file for the sorted
            records.  Unless otherwise specified, the new file is
            assigned the (.dbf) extension.

Options:    Order: SORT supports three sorting options:

            .  /A sorts in ascending order.

            .  /D sorts in descending order.

            .  /C sorts ignoring the case of the specified character
               field.

            Unless otherwise specified, the default SORT is in ascending
            order.

            Scope: The <scope> is the portion of the current
            database file to SORT.  The default is ALL.

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

Usage:      Clipper SORTs character fields in accordance with the ASCII
            value of each character within the string.  Numeric fields
            are SORTed in numeric order, and date fields are SORTed
            chronologically.  Logical and memo fields cannot be SORTed.
            Note that SET EXACT has no effect on SORTing.

            SORT performs as much of its operation as possible in memory
            and then it spools to a randomly named temporary disk file.
            This temporary file can be as large as the size of the
            source database file.  Note also that a SORT uses up three
            file handles:  the source database file, the target database
            file, and the temporary file.

            Deleted source records: If DELETED is OFF, SORT copies
            deleted records to the target database file and the deleted
            records retain their deleted status.  If DELETED is ON,
            deleted records are not copied to the target database file.

Network:    In a network environment, the database file to be SORTed
            should be locked with FLOCK() or USEed EXCLUSIVEly.

Library:    CLIPPER.LIB

See Also: INDEX ASORT()

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