Click or drag to resize

OrdKeyDel Function

X#
Delete a key from a custom built order.

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

Parameters

uOrder (Optional)
Type: Usual
The name of the order 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 omitted or NIL, the controlling order is assumed.
Specifying an invalid order, such as one that is not custom built, will raise a runtime error.
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.
xVal (Optional)
Type: Usual

Return Value

Type: Usual
TRUE if successful; otherwise FALSE.
Remarks
A custom built order is one that is not automatically maintained by the DBFCDX driver. You can determine if an order is custom built using DBOrderInfo(DBOI_CUSTOM, ...). When you create such an order, it is initially empty. You must manually add and delete keys using OrdKeyAdd() and OrdKeyDel(). OrdKeyDel() will fail if: The record pointer is positioned on an invalid record (for example, EOF() returns TRUE or the record pointer is positioned on a record that falls outside the orders' scope or for condition) The specified order is not custom built The specified order does not exist No order was specified and there is no controlling 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
Examples
This example creates a custom index, adds every fiftieth record to it, and deletes every hundredth record:
X#
 1USE customer VIA "DBFCDX"
 2// Create custom built order that is initially empty
 3INDEX ON LastName TO Last CUSTOM
 4// Add every 50th record
 5FOR n := 1 UPTO RecCount() STEP 50    
 6    GOTO n
 7    OrdKeyAdd()
 8NEXT
 9// Remove every 100th record
10FOR n := 1 UPTO RecCount() STEP 100
11    GOTO n
12    OrdKeyDel()
13NEXT
See Also