Purpose
Creates a new order on the data.
Class
Type
Method
Syntax
<oArrayServer>:CreateOrder(
<uExpression>,
[<uForCondition>],
[<uWhileCondition>],
[<lDescend>],
[<cbEval>],
[<iInterval>]
) Æ lSuccess
Arguments
<uExpression> | An expression for the order to be created. If the expression is specified as a string, it is converted automatically into a _Codeblock statement. The conversion is made here by the command |
&("{|Server| "+uExpression+"}")
Important note:
Only if the expression is defined as String this can be determined again with the method bArrayServer:OrderInfo(DBOI_EXPRESSION). This is not possible if the expression is defined as a Codeblock. In this case a NULL_STRING is returned.
Data Type: | String | Codeblock | _Codeblock |
<uForCondition> | A condition that each record must satisfy so that it is accepted in the order. If a record does not meet the condition, it is ignored and the next record processed. If the condition is specified as string it is converted automatically into a _Codeblock statement. The conversion is made here by the command |
&("{|Server| "+uForCondition+"}")
As a default, the value NIL is used.
Data Type: | String | Codeblock | _Codeblock |
<uWhileCondition> | A condition that each record must satisfy so that it is accepted in the order. As soon as a record is found, that the condition does not meet, it terminates creation of the order. If the condition is specified as string, it is converted automatically into a _Codeblock statement. The conversion is made here by the command |
&("{|Server| "+uWhileCondition+"}")
The WHILE condition is used only for creating the order. It is not used during execution of the order. As a default, the value NIL is used.
Data Type: | String | Codeblock | _Codeblock |
<lDescend> | A logical value that determines whether the order is to be created ascending (FALSE/default) or descending (TRUE). |
Data Type: | Logic |
<cbEval> | A code block that evaluates every < iInterval> steps. This can be used, for example, with progress counters. The return value of <cbEval> must be a logical value. If <cbEval> returns FALSE, the order procedure is terminated. As a default, the value NIL is used. |
Data Type: | Codeblock | _Codeblock |
<iInterval> | A numeric expression that determines the number of times <cbEval> is evaluated. This argument offers a performance enhancement by evaluating the condition at intervals instead of every record processed. So that the code block is evaluated with each record, the value 0 must used. As a default, the value 0 is used. |
Data Type: | DWord |
Return Value
lSuccess | A logical value indicates whether the order was created or not. |
TRUE | The order was created. |
FALSE | The order could not be created. |
Data Type: | Logic |
Description
With an order, the logical sequence of the records can be changed.
Before the order is created, the data server sends a NotifyIntentToMove message and calls afterwards the method bArrayServer:Commit().
In order to be able to access in the expression <uExpression> or in the conditions <uForCondition> or <uWhileCondition> to fields, accesses or methods of the server, the literal "Server" followed by a colon must be placed in front of these (see sample).
Samples
The following sample creates an order on the fields LASTNAME and FIRSTNAME. The expression is specified as string.
oasServer:CreateOrder("Server:LASTNAME+Server:FIRSTNAME")
The following sample creates an order on the fields LASTNAME and FIRSTNAME. The expression is specified as codeblock.
oasServer:CreateOrder({|Server|Server:LASTNAME+Server:FIRSTNAME})
See Also
Page url: http://www.YOURSERVER.com/index.html?barrayserver_createorder.htm