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


Syntax:     SET ORDER TO [<expN>]

Purpose:    To select a new controlling index.

Argument:   <expN> specifies the new controlling index by pointing
            to its position in the list of open indexes in the current
            work area.  This number can be in the range of zero to 15.

            SETting ORDER TO 0 restores the database file to natural
            order (record number order) leaving all indexes open.

Usage:      When you SET ORDER TO a new controlling index, all indexes
            are properly updated when you either append or edit
            records.  This is true even if you SET ORDER TO 0.  After a
            change of controlling indexes, the record pointer still
            points to the same record number in the new index.

            To determine which index is the current controlling index,
            use INDEXORD().

Library:    CLIPPER.LIB


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

   USE Customers
   INDEX ON Lastname TO Names
   INDEX ON City + State TO Region
   SET INDEX TO Names, Region

   SET ORDER TO 2
   ? INDEXKEY(INDEXORD())     && Result: City + State

   SET ORDER TO 0
   ? INDEXKEY(INDEXORD())     && Result: null value

   SET ORDER TO 1
   ? INDEXKEY(INDEXORD())     && Result: Lastname


See Also: SET INDEX USE INDEXKEY() INDEXORD()

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