[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
+---------------------------------+
|              SORT               |
+---------------------------------+
SORT TO <file>  ON <field1>
                [/A] [/D] [/C]
        [, <field2>
                [/A] [/D] [/C] ... ]
        [ASCENDING | DESCENDING]
        [<scope>]
        [FOR <expL1>] [WHILE <expL2>]
        [FIELDS <field list>]
        [NOOPTIMIZE]

-----------------------------------
Sorts database file.
-----------------------------------

Be sure you have enough disk space for the new database and the
temporary work files created during the sort.  The disk space needed to
perform a sort may be as much as three times that of the file in use.

<file>
        When database is sorted, new database file is created.  Include name of
new database <file>.  FoxPro assumes a .DBF extension for database
files.  If the file name you include does not have an extension, a .DBF
extension is automatically assigned.

ON <field1>
        You must include name of field (<field1>) from the currently selected
database.  This field's contents determine the order of the records in
new database.  By default, the sort is done in ascending order.  You may
not sort on memo fields.

        You may include additional fields (<field2>, <field3>) to further order
the new database.  The first field <field1> is the primary sort field,
<field2> is the secondary sort field and so on.

[/A] [/D] [/C]
        For each field you include in the sort you may specify an ascending or
descending sort order.  Including /A specifies an ascending order for
the field, /D a descending order.  /A and /D may be included with any
type of field.

        By including the /C option with a character field, case is ignored.
You may also combine the /C option with the /A and /D options.  If you
include the /C option with /A or /D, use one slash (/AC or /DC).

ASCENDING | DESCENDING
        You may specify a sort order for every sort field not followed by the
/A or /D options.  If you include ASCENDING, all sort fields are sorted
in ascending order.  If DESCENDING is included, all sort fields are
sorted in descending order.  If ASCENDING or DESCENDING isn't included,
the sort fields default to an ascending order.

<scope>
        You can include a <scope> of records to use in the sort.  The default
scope for SORT is all records.

FOR <expL1>
        If FOR <expL1> is included, only the records that satisfy the logical
condition <expL1> are included in the sort.

        Rushmore will optimize a SORT FOR query if <expL1> is an optimizable
expression.  For best performance, use an optimizable expression in the
FOR clause.

WHILE <expL2>
        If WHILE <expL2> is included, records from the currently selected
database are included in the sort for as long as the logical expression
<expL2> evaluates to true (.T.).

FIELDS <fields list>
        The new database that SORT creates may contain a subset of fields from
the original database.  If FIELDS isn't included, all fields from the
original database are included in the new database.  To include specific
fields from the original database, include FIELDS and a <fields list>.

NOOPTIMIZE
        Disables Rushmore.

-----------------------------------

See Also:  COPY TO, INDEX

-----------------------------------

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