Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper 5.3 . Guide To CA-Clipper - <b>orddescend()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 ORDDESCEND()
 Return and optionally change the descending flag of an order
------------------------------------------------------------------------------
 Syntax

     ORDDESCEND([<cOrder> | <nPosition>],[<cIndexFile>],
        [<lNewDescend>]) --> lCurrentDescend

 Arguments

     <cOrder> | <nPosition> is the name of the order or a number
     representing its position in the order list.  Using the order name is
     the preferred method since the position may be difficult to determine
     using multiple-order index files.  If omitted or NIL, the controlling
     order is assumed.

     Specifying an invalid value will raise a runtime error.

     <cIndexFile> is the name of an index file, including an optional
     drive and directory (no extension should be specified).  Use this
     argument with <cOrder> to remove ambiguity when there are two or more
     orders with the same name in different index files.

     If <cIndexFile> is not open by the current process, a runtime error is
     raised.

     <lNewDescend> is a logical value that if true (.T.) dynamically
     turns on the descending flag for the order, resulting in descending
     order.  False (.F.) dynamically turns the flag off, resulting in
     ascending order.

 Returns

     If <lNewDescend> is not specified, ORDDESCEND() returns the current
     setting.  If <lNewDescend> is specified, the previous setting is
     returned.

 Description

     ORDDESCEND() changes the ascending/descending flag at runtime only--it
     does not change the descending flag stored in the actual index file.  To
     change the descending flag in the index file, see the INDEX command in
     the Reference Guide, Volume 1.

     By default, this function operates on the currently selected work area.
     It will operate on an unselected work area if you specify it as part of
     an aliased expression.

 Examples

     .  The following example illustrates ORDDESCEND().  Every order
        can be both ascending and descending:

        USE Customer VIA "DBFCDX"
        INDEX ON LastName TAG Last
        INDEX ON FirstName TAG First DESCENDING

        SET ORDER TO TAG Last
        // Last was originally created in ascending order

        // Swap it to descending
        ORDDESCEND(,, .T.)
        // Last will now be processed in descending order

        SET ORDER TO TAG First
        // First was originally created in descending order

        // Swap it to ascending
        ORDDESCEND(,, .F.)
        // First will now be processed in ascending order

 Files   Library is CLIPPER.LIB.


See Also: INDEX

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