C5_ORDSKIPUNIQUE

 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()


 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.