Click or drag to resize

DbServer.OrderSkipUnique Method

X#
Move the record pointer to the next or previous unique key in the controlling order.

Namespace:  VO
Assembly:  VORDDClasses (in VORDDClasses.dll) Version: 2.19
Syntax
 VIRTUAL METHOD OrderSkipUnique(
	nDirection
) AS USUAL CLIPPER
Request Example View Source

Parameters

nDirection (Optional)
Type: Usual
Specifies whether the method will skip to the next or previous key. Omitting this value or specifying it as 1 skips to the next unique key. Specifying a negative value skips to the previous key.

Return Value

Type: Usual
TRUE if successful; otherwise, FALSE.
Remarks
DBServer:OrderSkipUnique() allows you to make a non-unique order look like a unique order. Each time you use DBServer:OrderSkipUnique(), you are moved to the next (or previous) unique key, exactly as if you were skipping through a unique order. This method eliminates the problems associated with maintaining a unique order, while providing you with fast access to unique keys. DBServer:OrderSkipUnique() sends a NotifyIntentToMove message before the operation.
It also sends a NotifyRecordChange message upon successful completion.
Examples
This examples uses DBServer:OrderSkipUnique() to build an array of unique last names beginning with the letter "J:"
X#
 1METHOD LastUnique() CLASS Customer
 2LOCAL aLast[0] AS ARRAY
 3SELF:SetIndex("last")     // Use the last name order
 4? SELF:OrderIsUnique()     // Result: FALSE
 5// Only look at the J's
 6SELF:OrderScope(0, "J")
 7SELF:OrderScope(1, "J")
 8SELF:GoTop()
 9DO WHILE !SELF:EOF          // Add all the unique J
10AADD(aLast, Last)     // last names to aLast
11SELF:OrderSkipUnique()
12ENDDO
13// Clear the scope
14SELF:OrderScope(0, NIL)
15SELF:OrderScope(1, NIL)
16RETURN aLast
See Also