DbServer.OrderDescend Method | |
Return and optionally change the descending flag of an order.
Namespace:
VO
Assembly:
VORDDClasses (in VORDDClasses.dll) Version: 2.19
Syntax VIRTUAL METHOD OrderDescend(
uOrder,
oFSIndex,
lNew
) AS USUAL CLIPPER
[ClipperCallingConventionAttribute(new string[] { ... })]
public virtual Usual OrderDescend(
Usual uOrder = default,
Usual oFSIndex = default,
Usual lNew = 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.
- oFSIndex (Optional)
- Type: Usual
A string or filespec object that specifies 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 oFSIndex is not open by the current process, a runtime error is raised.
- lNew (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:
Usual
If
lNew is not specified, DBServer:OrderDescend() returns the current setting. If
lNewDescend is specified, the previous setting is returned.
Remarks
DBServer:OrderDescend() changes the ascending/descending flag at runtime only—it does not change the descending flag stored in the actual index file.
Tip |
---|
If you are using DbServer:OrderDescend() with Scopes, you need to swap the Top and Bottom scope values !
1oServer:OrderScope (TOPSCOPE, cFrom)
2oServer:OrderScope (BOTTOMSCOPE, cTo)
3oServer:OrderDescend(,, TRUE)
4oServer:OrderScope (TOPSCOPE, cTo)
5oServer:OrderScope (BOTTOMSCOPE, cFrom) |
Examples
The following example illustrates DBServer:OrderDescend(); every order can be both ascending and descending:
1LOCAL oDBCust AS DBServer
2oDBCust := Customer{}
3oDBCust:CreateOrder("Last", "customer", "oDBCust:LastName")
4oDBCust:SetOrderCondition(,,,,,,,,,, TRUE)
5oDBCust:CreateOrder("First", "customer", "oDBCust:FirstName")
6oDBCust:SetOrder("Last")
7oDBCust:OrderDescend(,, TRUE)
8
9oDBCust:SetOrder("First")
10oDBCust:OrderDescend(,, FALSE)
11
See Also