Click or drag to resize

VoDbOrdDestroy Function

X#
Remove an order from an open index file.
Remove an order from an open index file.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax
 FUNCTION VoDbOrdDestroy(
	cIndexFile AS STRING,
	uOrder AS USUAL
) AS LOGIC
Request Example 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 order to be removed 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 the order cannot be found, a runtime error is raised.

Return Value

Type: Logic
TRUE if successful; otherwise, FALSE.

Return Value

Type: Logic
Remarks
DBDeleteOrder() requires that the current database be open in exclusive mode.
If this condition is not met when DBDeleteOrder() is invoked, a runtime error is raised. DBDeleteOrder() deletes one order from a multiple-order index file and removes the order from the current order list. To delete the entire index file, use a regular file handling function such as Windows DeleteFile(). 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
Tip Tip
The RDD determines the order capacity of an index file, and DBDeleteOrder() is supported only by RDDs with multiple-order capabilities.
For single-order index files, you must delete the entire file.
Third-party RDD suppliers may define specific behaviors for this function.
Remarks
VODBOrdDestroy() is the same as DBDeleteOrder() except that it is strongly typed and the order of the arguments is reversed.
This function, however, does not call the error handler and will not, therefore, produce a runtime error message or create an error object if it fails. Thus, it may be important to check the return value to determine if the function succeeded.
the LastRddError property in the runtime state. will contain needed information regarding any error that occurs.
See DbDeleteOrder(Usual, Usual) for more information
Examples
In this example, since both open index files may contain an order named CUACCT, the DBDeleteOrder() function distinguishes which index file to use:
X#
1USE customer VIA "DBFMDX" NEW
2Customer->DBSetIndex("customer")
3Customer->DBSetIndex("custtemp")
4Customer->DBDeleteOrder("cuacct", "customer")
Examples