OrdScope Function | |
Set or clear the boundaries for scoping key values in the controlling order.
Namespace:
XSharp.RT
Assembly:
XSharp.RT (in XSharp.RT.dll) Version: 2.21
Syntax FUNCTION OrdScope(
kScope,
uNewValue
) AS USUAL CLIPPER
[ClipperCallingConventionAttribute(new string[] { ... })]
public static Usual OrdScope(
Usual kScope = default,
Usual uNewValue = default
)
Request Example
View SourceParameters
- kScope (Optional)
- Type: Usual
A number specifying the top (TOPSCOPE) or bottom (BOTTOMSCOPE) boundary. - uNewValue (Optional)
- Type: Usual
The top or bottom range of key values that will be included in the controlling order's current scope. uNewValue can be an expression that matches the data type of the key expression in the controlling order or a code block that returns the correct data type.
Omitting uNewValue or specifying it as NIL has the special effect of resetting the specified scope to its original default.
The default top range is the first logical record in the controlling order, and the default bottom range is the last logical record.
Return Value
Type:
Usual
If
uNewValue is not specified, OrdScope() returns and clears the current setting.
If
uNewValue is specified, the function sets it and the previous setting is returned.
Remarks
The range of values specified using OrdScope() is inclusive. In other words, the keys included in the scope will be greater than or equal the top boundary and less than or equal to the bottom boundary.
Note:
To return current settings without changing them, call the DBOrderInfo() function, using the DBOI_SCOPETOP and DBOI_SCOPEBOTTOM constants.
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 illustrates using OrdScope() to set various scoping limitations on an order:
1USE friends
2SET INDEX TO age
3
4OrdScope(TOPSCOPE, 25)
5
6OrdScope(BOTTOMSCOPE, 30)
7LIST Age
8
9
10OrdScope(BOTTOMSCOPE, 35)
11LIST Age
12
13
14OrdScope(TOPSCOPE, NIL)
15LIST Age
16
17OrdScope(BOTTOMSCOPE, NIL)
18LIST Age
See Also