OrdSkipUnique Function | |
Move the record pointer to the next or previous unique key in the controlling order.
Namespace:
XSharp.RT
Assembly:
XSharp.RT (in XSharp.RT.dll) Version: 2.21
Syntax FUNCTION OrdSkipUnique(
nDirection
) AS USUAL CLIPPER
[ClipperCallingConventionAttribute(new string[] { ... })]
public static Usual OrdSkipUnique(
Usual nDirection = default
)
Request Example
View SourceParameters
- nDirection (Optional)
- Type: Usual
Specifies whether the function 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
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 can be made to operate on an unselected work area by specifying
it within an aliased expression
Examples
This examples uses OrdSkipUnique() to build an array of unique last names beginning with the letter "J:"
1FUNCTION LastUnique()
2 LOCAL aLast[0]
3 SET INDEX TO last
4 ? OrdIsUnique()
5 SET SCOPE TO "J"
6 GO TOP
7 DO WHILE !EOF()
8 AADD(aLast, Last)
9 OrdSkipUnique()
10 ENDDO
11 SET SCOPE TO
12 RETURN aLast
13
See Also