Click or drag to resize

VoDbOrdListClear Function

X#
Remove orders from the order list in a work area and close associated index files.
Remove orders from the order list in a work area and close associated index files.

Namespace:  XSharp.RT
Assembly:  XSharp.RT (in XSharp.RT.dll) Version: 2.21
Syntax
 FUNCTION VoDbOrdListClear(
	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 uOrder to remove ambiguity when there are two or more orders with the same name in different index files.
Use it alone to close only those orders associated with the specified file.
If cIndexFile is not open by the current process, a runtime error is raised.
uOrder
Type: Usual
The name of the order to clear 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 not specified, all orders in the specified index file (or the entire work area, if no index file is specified) are cleared.
Invalid values are ignored.

Return Value

Type: Logic
TRUE if successful; otherwise FALSE.

Return Value

Type: Logic
Remarks
All pending updates are written to disk prior to closing the index files.
Once the files are closed and the order list cleared, the database file returns to its natural order. 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
VODBOrdListClear() is the same as DBClearIndex() 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.
Examples
The following example closes index files if any are open:
X#
 1DBUseArea(TRUE, "DBFNTX", "sales", "Sales", ;
 2            TRUE)
 3Sales->DBSetIndex("FirstName")
 4Sales->DBSetIndex("LastName")
 5// Are there any open index files?
 6IF Sales->DBOrderInfo(DBOI_NUMBER) > 0
 7    Sales->DBClearIndex()        // Close index files
 8ENDIF
 9// Copy to SDF in natural order
10COPY TO temp SDF
Examples