Click or drag to resize

DbDeleteOrder Function

X#
Remove an order from an open index file.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.19
Syntax
 FUNCTION DbDeleteOrder(
	uOrder,
	cIndexFile
) AS LOGIC CLIPPER
Request Example View Source

Parameters

uOrder (Optional)
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.
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.

Return Value

Type: Logic
TRUE if successful; otherwise, FALSE.
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.
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")
See Also