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>ordskipunique()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 ORDSKIPUNIQUE()
 Move the record pointer to the next or previous unique key in the controlling
 order
------------------------------------------------------------------------------
 Syntax

     ORDSKIPUNIQUE([<nDirection>]) --> lSuccess

 Arguments

     <nDirection> specifies whether the function will skip to the next or
     previous key.  Omitting this value or specifying it as 1 causes the
     record pointer to skip to the next unique key.  Specifying a negative
     value makes it skip to the previous key.

 Returns

     ORDSKIPUNIQUE() returns true (.T.) if successful; otherwise, it returns
     false (.F.).

 Description

     ORDSKIPUNIQUE() allows you to make a non-unique order look like a unique
     order.  Each time you use ORDSKIPUNIQUE(), you are moved to the next (or
     previous) unique key exactly as if you were skipping through a unique
     order.  This function eliminates the problems associated with
     maintaining a unique order, while providing you with fast access to
     unique keys.

     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

     .  This example uses ORDSKIPUNIQUE() to build an array of unique
        last names beginning with the letter "J":

        FUNCTION LASTUNIQUE()
           LOCAL aLast[0]
           SET INDEX TO Last          // Use the last name order
           ? ORDISUNIQUE()            // Result: .F.
           SET SCOPE TO "J"           // Only look at the J's

           GO TOP
           DO WHILE !EOF()            // Add all the unique J
              AADD(aLast, Last)       // last names to aLast
              ORDSKIPUNIQUE()
           ENDDO

           SET SCOPE TO               // Clear the scope
           RETURN aLast               // Return array of
                                      // unique J names

 Files   Library is CLIPPER.LIB.


See Also: INDEX ORDISUNIQUE()

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