OrdDescend Function | |
Return and optionally change the descending flag of an order.
Namespace:
XSharp.RT
Assembly:
XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax FUNCTION OrdDescend(
uOrder,
cIndexFile,
lNewDescend
) AS LOGIC CLIPPER
[ClipperCallingConventionAttribute(new string[] { ... })]
public static bool OrdDescend(
Usual uOrder = default,
Usual cIndexFile = default,
Usual lNewDescend = default
)
Request Example
View SourceParameters
- uOrder (Optional)
- Type: Usual
The name of the order or a number representing its position in the order list.
Using the order name is the preferred method since the position may be difficult to determine using multiple-order index files.
If omitted or NIL, the controlling order is assumed.
Specifying an invalid value will raise a runtime error.
- cIndexFile (Optional)
- Type: Usual
The name of an index file, including an optional drive and directory (no extension should be specified).
Use this argument with cOrder to remove ambiguity when there are two or more orders with the same name in different index files.
If cIndexFile is not open by the current process, a runtime error is raised.
- lNewDescend (Optional)
- Type: Usual
TRUE dynamically turns on the descending flag for the order, resulting in descending order. FALSE dynamically turns the flag off, resulting in ascending order.
Return Value
Type:
Logic
If
lNewDescend is not specified, OrdDescend() returns the current setting.
If
lNewDescend is specified, the previous setting is returned.
Remarks
OrdDescend() changes the ascending/descending flag at runtime only — it does not change the descending flag stored in the actual index file.
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
The following example illustrates OrdDescend(), every order can be both ascending and descending.
1USE customer VIA "DBFCDX"
2INDEX ON LastName TAG Last
3INDEX ON FirstName TAG First DESCENDING
4SET ORDER TO TAG Last
5
6
7OrdDescend(,, TRUE)
8
9SET ORDER TO TAG First
10
11
12OrdDescend(,, FALSE)
13
See Also