DbServer.OrderDescend Method (Usual, FileSpec, Usual) | |
Return and optionally change the descending flag of an order.
Namespace:
XSharp.VO.SDK
Assembly:
XSharp.VORDDClasses (in XSharp.VORDDClasses.dll) Version: 2.21
Syntax VIRTUAL METHOD OrderDescend(
uOrder AS USUAL,
oFSIndex AS FileSpec,
lNew AS USUAL
) AS LONG
public virtual int OrderDescend(
Usual uOrder,
FileSpec oFSIndex,
[DefaultParameterValueAttribute(0, 1)] Usual lNew
)
Request Example
View SourceParameters
- uOrder
- 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
- Type: FileSpec
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
- 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:
Long
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