ORDSCOPE() Set or clear the boundaries for scoping key values in the controlling order ------------------------------------------------------------------------------ Syntax ORDSCOPE(<nScope>, [<expNewValue>]) --> uCurrentValue Arguments <nScope> is a number specifying the top (TOPSCOPE) or bottom (BOTTOMSCOPE) boundary. Note: To use the TOPSCOPE and BOTTOMSCOPE constants, you must include (#include) the Ord.ch header file in your application. <expNewValue> is the top or bottom range of key values that will be included in the controlling order's current scope. <expNewValue> 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 <expNewValue> 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. Returns If <expNewValue> is not specified, ORDSCOPE() returns and clears the current setting. If <expNewValue> is specified, the function sets it and the previous setting is returned. Description The range of values specified using ORDSCOPE() is inclusive. In other words, the keys included in the scope will be greater than or equal to 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. Examples . This example illustrates using ORDSCOPE() to set various scoping limitations on an order: USE Friends SET INDEX TO Age // Make 25 the lowest age in range ORDSCOPE(TOPSCOPE, 25) // Make 30 the highest age in range ORDSCOPE(BOTTOMSCOPE, 30) LIST Age // Shows records with // 25 <= Age <= 30 // Change highest age to 35 ORDSCOPE(BOTTOMSCOPE, 35) LIST Age // Shows records with // 25 <= Age <= 35 // Reset top boundary ORDSCOPE(TOPSCOPE, NIL) LIST Age // Shows records with // Age <= 35 // Reset bottom boundary ORDSCOPE(BOTTOMSCOPE, NIL) LIST Age // Shows all records Files Library is CLIPPER.LIB, header file is Ord.ch.
See Also: SET SCOPE SET SCOPEBOTTOM SET SCOPETOP
Pingback: C5_SET SCOPETOP | Viva Clipper !
Pingback: C5_SET SCOPEBOTTOM | Viva Clipper !
Pingback: C5_SET SCOPE | Viva Clipper !