DbServer.OrderKeyDel Method (Usual, FileSpec) | |
Delete a key from a custom built order.
Namespace:
XSharp.VO.SDK
Assembly:
XSharp.VORDDClasses (in XSharp.VORDDClasses.dll) Version: 2.19
Syntax VIRTUAL METHOD OrderKeyDel(
uOrder AS USUAL,
oFSIndex AS FileSpec
) AS LONG
public virtual int OrderKeyDel(
Usual uOrder,
FileSpec oFSIndex
)
Request Example
View SourceParameters
- uOrder
- 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 value will raise a runtime error.
- oFSIndex
- Type: FileSpec
A string or filespec object that specifies 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 oFSIndex is not open by the current process, a runtime error is raised.
Return Value
Type:
Long
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 DBServer:OrderInfo(DBOI_CUSTOM, ...). When you create such an order, it is initially empty.
You must manually add and delete keys using DBServer:OrderKeyAdd() and DBServer:OrderKeyDel().
DBServer:OrderKeyDel() will fail if:
-
The record pointer is positioned on an invalid record (for example, DBServer: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
Examples
This example creates a custom index, adds every fiftieth record to it, and deletes every hundredth record:
1oDBCust := Customer{}
2
3oDBCust:SetOrderCondition(,,,,,,,,,,,,, TRUE)
4oDBCust:CreateIndex("last", "oDBCust:LastName")
5
6FOR n := 1 UPTO oDBCust:RecCount STEP 50
7oDBCust:GoTo(n)
8oDBCust:OrderKeyAdd()
9NEXT
10
11FOR n := 1 UPTO oDBCust:RecCount STEP 100
12oDBCust:GoTo(n)
13oDBCust:OrderKeyDel()
14NEXT
See Also