DbServer.SetOrderCondition Method (Typed) | |
Set conditions that is applied to index and order creation. If SetOrderCondition() has not been called, order creation is subject to the general server scope. If neither has been set, orders are not conditional.
Namespace:
XSharp.VO.SDK
Assembly:
XSharp.VORDDClasses (in XSharp.VORDDClasses.dll) Version: 2.21
Syntax VIRTUAL METHOD SetOrderCondition(
cFor,
cbForBlock,
lAll,
cbWhileBlock,
cbEvalBlock,
nStep,
nStart,
nNext,
nRecno,
lRest,
lDescending,
lAdditive,
lCurrent,
lCustom,
lNoOptimize
) AS LOGIC CLIPPER
[ClipperCallingConventionAttribute(new string[] { ... })]
public virtual bool SetOrderCondition(
Usual cFor = default,
Usual cbForBlock = default,
Usual lAll = default,
Usual cbWhileBlock = default,
Usual cbEvalBlock = default,
Usual nStep = default,
Usual nStart = default,
Usual nNext = default,
Usual nRecno = default,
Usual lRest = default,
Usual lDescending = default,
Usual lAdditive = default,
Usual lCurrent = default,
Usual lCustom = default,
Usual lNoOptimize = default
)
Request Example
View SourceParameters
- cFor (Optional)
- Type: Usual
A string that specifies the FOR condition for the order. If you do not need this information, you can specify a NULL_STRING. - cbForBlock (Optional)
- Type: Usual
A code block that defines a FOR condition that each record within the scope must meet in order to be processed. Only those records that meet the condition are included in the resulting order. Duplicate key values are not added to the index file.
The FOR condition is stored as part of the index file and used when updating or recreating the index using the DBServer:Reindex() method. The FOR clause provides the only scoping that is maintained for all database changes. All other scope conditions create orders that do not reflect database updates.
If a string is provided, it is compiled into a code block dynamically. It can be no longer than 250 characters under the DBFNTX driver.
- lAll (Optional)
- Type: Usual
Specifies all orders in the current or specified work area. ALL is the default scope of INDEX ON. - cbWhileBlock (Optional)
- Type: Usual
A code block that specifies another condition that must be met by each record as it is processed. As soon as a record is encountered that causes the condition to fail, the order creation terminates. If a WHILE clause is specified, the data is processed in the controlling order.
The WHILE condition is transient (that is, it is not stored in the file and not used for index updates and reindexing purposes). The WHILE condition creates temporary orders, but these orders are not updated.
Using the WHILE condition is more efficient and faster than using the FOR condition. The WHILE condition processes only data for which cbWhileCondition is TRUE from the current position. The FOR condition, in contrast, processes all data in the data source.
- cbEvalBlock (Optional)
- Type: Usual
The code block that is evaluated for every record that is processed, or as specified below. This code block allows the application to intercede during the order creation, which might be quite lengthy; it might be used to update the screen, for example, showing progress on a thermometer-type display or in the status bar. - nStep (Optional)
- Type: Usual
The numeric expression that modifies the number of times cbEvalBlock is evaluated. This argument offers a performance enhancement by evaluating the condition for every nth record instead of for every record ordered. To step through every record, specify a value of 0 or omit the parameter.
- nStart (Optional)
- Type: Usual
The record number to start the evaluation from. To start at the top, specify a value of 0 or omit the parameter. - nNext (Optional)
- Type: Usual
The number of records to process, starting at nStart. Specify 0 to ignore this argument.
- nRecno (Optional)
- Type: Usual
A single record number to process. Specify 0 to ignore this argument. - lRest (Optional)
- Type: Usual
Specifies whether the scope of processing is all records, or, starting with the current record, all records to the end of file. This argument corresponds to the REST and ALL clauses of record processing commands. If TRUE , the scope is REST; otherwise, the scope is ALL records. - lDescending (Optional)
- Type: Usual
Specifies whether the keyed pairs be sorted in decreasing or increasing order of value. If TRUE the order is in descending order otherwise the order is in ascending order. - lAdditive (Optional)
- Type: Usual
Specifies whether open orders should remain open while the new order is being created. TRUE specifies that they should remain open. FALSE specifies that all open order should be closed. The default is FALSE. - lCurrent (Optional)
- Type: Usual
Specifies whether only records in the controlling order—and within the current range as specified by DBServer:OrderScope()—will be included in this order. TRUE specifies that the controlling order and range should be used to limit the scope of the newly created order. FALSE specifies that all records in the database file are included in the order. The default is FALSE. - lCustom (Optional)
- Type: Usual
Specifies whether the new order will be a custom built order (for RDDs that this feature). TRUE specifies that a custom built order will be created. A custom built order is initially empty, giving you complete control over order maintenance. The system does not automatically add and delete keys from a custom built order. Instead, you explicitly add and delete keys using DBServer:OrderKeyAdd() and DBServer:OrderKeyDel(). FALSE specifies a standard, system-maintained order. The default is FALSE. - lNoOptimize (Optional)
- Type: Usual
Specifies whether the FOR condition will be optimized (for RDDs that support this feature). TRUE optimizes the FOR condition, and FALSE does not. The default is FALSE.
Return Value
Type:
Logic
TRUE if successful; otherwise, FALSE.
See Also