Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Comix 3.0 Reference Manual - <b>cmxdescend()</b> get/set descending flag of an index http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
cmxDescend()          Get/set descending flag of an index
------------------------------------------------------------------------------

Synopsis

    cmxDescend( [nOrder | cTag [, cBag [, lDescend]]] ) -> lPrevDescend

Arguments

    nOrder, cTag and cBag are optional parameters which specify the index.
    If omitted or NIL, the current master index will be used.

    nOrder is the numeric order of the index.

    cTag is the tag of the index, and cBag is the specific index file in
    which to find cTag.

    lDescend is optional.  If provided, it allows you to dynamically set an
    index to be in descending (if .T.), or in ascending order (if .F.).

Returns

    cmxDescend() returns whether or not the index was previously descending.

Description

    cmxDescend() boths gets the current descending flag for the order, and
    allows you to set it.  This feature gives you "two for the price of one
    indexes", in that every index you have can be both an ascending _and_ a
    descending index.

    Please note that this changes the ascending/descending at runtime only
    (i.e., it does not change the descending flag stored on disk for the
    file).
    
Example

    use demo
    index on last tag last
    index on first tag first descending

    set order to tag last
    list last, first                && last name, ascending order

    cmxDescend(,, .t.)              && Swap it to descending
    list last, first                && last name, descending order

    set order to tag first
    list last, first                && first name, descending order

    cmxDescend("first", nil, .f.)   && Change second index (first) to
                                    && ascending
    list last, first                && first name, ascending order

See Also

    SET DESCENDING


See Also: INDEX SET DESCENDING

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