Click or drag to resize

Functions.DbDeleteOrder Method

Remove an order from an open index file.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.16
 FUNCTION DbDeleteOrder(
Request Example View Source


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.
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
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.
In this example, since both open index files may contain an order named CUACCT, the DBDeleteOrder() function distinguishes which index file to use:
1USE customer VIA "DBFMDX" NEW
4Customer->DBDeleteOrder("cuacct", "customer")
See Also