Click or drag to resize

VoDbOrdSetFocus Function

Set the controlling order for a work area.
Set the controlling order for a work area.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.10
Syntax
 FUNCTION VoDbOrdSetFocus(
	cIndexFile AS STRING,
	uOrder AS USUAL,
	cOrder OUT STRING
) AS LOGIC
View Source

Parameters

cIndexFile
Type: String
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.
uOrder
Type: Usual
The name of the new controlling 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.  Specifying a value of 0 has the special effect of returning the database file to its natural order.  Specifying an invalid value will raise a runtime error.
cOrder
Type: String
This returns the previous order that was selected.

Return Value

Type: Boolean
TRUE if successful; otherwise, FALSE.

Return Value

Type: Boolean
TRUE if successful; otherwise, FALSE.
Remarks
DBSetOrder() controls which of the orders in a work area's order list is the controlling order.  The controlling order is the one that determines the logical order of records in the work area.  Before using this function, use DBSetIndex() to add orders from an index file to the order list. 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
Remarks
VODBOrdSetFocus() is similar to DBSetOrder() except that it is strongly typed and the order of the arguments is reversed.  Also, the third argument <pszPreviousOrder> points to the old controlling order.  See DBSetOrder() for more information and an example.
Examples
This example sets the second named order, AGE, as the controlling order:
X#
USE employee NEW
Employee->DBSetIndex("name")
Employee->DBSetIndex("age")
DBSetOrder("age")
Examples