Click or drag to resize

VoDbOrdDestroy Function

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.6
 FUNCTION VoDbOrdDestroy(
	cIndexFile AS STRING,
	uOrder AS USUAL
Request Example View Source


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.
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: Boolean
TRUE if successful; otherwise, FALSE.

Return Value

Type: Boolean
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.
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 global structure, StrucErrInfo, will contain needed information regarding any error that occurs.
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")