C5_ORDSCOPE

 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



Advertisements

3 responses to “C5_ORDSCOPE

  1. Pingback: C5_SET SCOPETOP | Viva Clipper !

  2. Pingback: C5_SET SCOPEBOTTOM | Viva Clipper !

  3. Pingback: C5_SET SCOPE | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.