ORDKEYDEL() Delete a key from a custom built order ------------------------------------------------------------------------------ Syntax ORDKEYDEL([<cOrder> | <nPosition>], [<cIndexFile>], [<expKeyValue>]) --> lSuccess Arguments <cOrder> | <nPosition> is 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> is 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. <expKeyValue> is a specific key value that you want to delete for the current record. The data type must match that of the order. If not specified, the order's key expression is evaluated for the current record and deleted from the order. Returns ORDKEYDEL() returns true (.T.) if successful; otherwise, it returns false (.F.). Description ORDKEYDEL() deletes a key from a custom built order which is an order 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 then manually add and delete keys using ORDKEYADD() and ORDKEYDEL(). Note: An existing order can be changed to a custom built order by using the DBORDERINFO() function. ORDKEYDEL() evaluates the key expression (or <expKeyValue>, if specified), and then deletes the key for the current record from the order. ORDKEYDEL() will fail if: . The record pointer is positioned on an invalid record (for example, EOF() returns true (.T.) or the record pointer is positioned on a record that falls outside the order's 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 will operate on an unselected work area if you specify it as part of an aliased expression. Examples . This example creates a custom index, adds every fiftieth record to it, and deletes every hundredth record: USE Customer VIA "DBFCDX" // Create custom-built order that is initially empty INDEX ON LastName TO Last CUSTOM // Add every 50th record FOR n := 1 TO RECCOUNT() STEP 50 GOTO n ORDKEYADD() NEXT // Remove every 100th record FOR n := 1 TO RECCOUNT() STEP 100 GOTO n ORDKEYDEL() NEXT Files Library is CLIPPER.LIB.
See Also: ORDFOR() ORDKEYADD() ORDSCOPE()