SET SCOPETOP

SET SCOPETOP

Change the top boundary for scoping key values in the controlling order

Syntax

      SET SCOPETOP TO [<expNewTop>]

Arguments

<expNewTop> is the top range of key values that will be included in the controlling order’s current scope. <expNewTop> 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.

Description

SET SCOPETOP, when used with the <expNewTop> argument, is functionally equivalent to ORDSCOPE(0, <expNewTop>). SET SCOPETOP, when used with no argument, is functionally equivalent to ORDSCOPE(0, NIL). Refer to the ORDSCOPE() function for more information.

Examples

      .  The following example illustrates the SET SCOPETOP command:

      USE Inventor NEW
      INDEX ON PartNo TO Parts

      SET SCOPETOP TO 1000
      // Only part numbers greater than or equal to 1000
      // will be used.

Seealso

ORDSCOPE(), SET SCOPE, SET SCOPEBOTTOM

SET SCOPEBOTTOM

SET SCOPEBOTTOM

Change the bottom boundary for scoping key values in the controlling order

Syntax

      SET SCOPEBOTTOM TO [<expNewBottom>]

Arguments

<expNewBottom> is the bottom range of key values that will be included in the controlling order’s current scope. <expNewBottom> 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.

Description

SET SCOPEBOTTOM, when used with the <expNewBottom> argument, is functionally equivalent to ORDSCOPE(1, <expNewBottom>). SET SCOPEBOTTOM, when used with no argument, is functionally equivalent to ORDSCOPE(1, NIL). Refer to the ORDSCOPE() function for more information.

Examples

      .  The following example illustrates the SET SCOPEBOTTOM command:

         USE Inventor NEW
         INDEX ON PartNo TO Parts
         SET SCOPEBOTTOM TO 1000
         // Only part numbers less than or equal to 1000
         // will be used.

Seeaalso

ORDSCOPE(), SET SCOPE, SET SCOPETOP

SET SCOPE

SET SCOPE

Change the top and/or bottom boundaries for scoping key values in the controlling order

Syntax

      SET SCOPE TO [<expNewTop> [, <expNewBottom>]]

Arguments

<expNewTop> is the top range of key values that will be included in the controlling order’s current scope. <expNewTop> 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.

<expNewBottom> is the bottom range of key values that will be included in the controlling order’s current scope. <expNewBottom> 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.

Note

If <expNewBottom> is not specified, <expNewTop> is taken for both the top and bottom range values.

Description

SET SCOPE, when used with no arguments, clears the top and bottom scopes; this is equivalent to ORDSCOPE(0, NIL) followed by ORDSCOPE(1, NIL). If <expNewTop> is specified alone, SET SCOPE sets the top and bottom scope to the indicated value (i.e., ORDSCOPE(0, <expNewTop>) followed by ORDSCOPE(1, <expNewTop>). If both <expNewTop> and <expNewBottom> are specified, SET SCOPE sets the top and bottom scope as indicated (i.e., ORDSCOPE(0, <expNewTop>) followed by ORDSCOPE(1, <expNewBottom>). Refer to the ORDSCOPE() function for more information.

Examples

      .  The following example illustrates the SET SCOPE command:

         USE Inventor NEW
         INDEX ON PartNo TO Parts

         SET SCOPE TO 1750, 2000
         // Only part numbers between 1750 and 2000 will be used

Seealso

ORDSCOPE(), SET SCOPEBOTTOM, SET SCOPETOP

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



C5 Index Commands and Functions

Index Commands and Functions

Commands :

DELETE TAG :

Delete a Tag

DELETE TAG <cOrderName> [IN <xcOrderBagName>]
    [, <cOrderName> [IN xcOrderBagName] list>]

INDEX ON … :

Create an index file

INDEX ON <expKey>
    [TAG <cOrderName>]
    TO <xcOrderBagName>
    [FOR <lCondition>] [ALL]
    [WHILE <lCondition>]
    [NEXT <nNumber>]
    [RECORD <nRecord>]
    [REST]
    [EVAL <bBlock>
    [EVERY <nInterval>]
    [UNIQUE]
    [ASCENDING|DESCENDING]

REINDEX :

Rebuild open indexes in the current workarea

REINDEX
    [EVAL <lCondition>]
    [EVERY <nRecords>]]

SET INDEX

Open index file(s) in the current work area

SET INDEX TO [<xcIndex list>]

SET ORDER

Set a new controlling index

SET ORDER TO [<nOrder> | [TAG <cOrderName>]
    [IN <xcOrderBagName>]]>

SET UNIQUE* : 

Toggle the inclusion of nonunique keys into an index

SET UNIQUE on | OFF | <xlToggle>

Functions :

DBCLEARINDEX() :

Close all indexes for the current work area

DBCLEARINDEX() --> NIL

DBCREATEINDEX() :

Create an index file

DBCREATEINDEX( <cIndexName>, <cKeyExpr>,
    <bKeyExpr>, 
    [<lUnique>] ) --> NIL

DBREINDEX() : 

Recreate all active indexes for the current work area

DBREINDEX() --> NIL

DBSEEK() : 

Move to the record having the specified key value

DBSEEK( <expKey>, [<lSoftSeek>] ) --> lFound

DBSETINDEX() : 

Open an index for the current work area

 DBSETINDEX( <cIndexName> ) --> NIL
 DBSETINDEX( <cOrderBagName> ) --> NIL

DBSETORDER() : 

Set the controlling order for the current work area

DBSETORDER( <nOrderNum> ) --> NIL

DESCEND() : 

Return a descending index key value

DESCEND( <exp> ) --> ValueInverted

FOUND() : 

Determine if the previous search operation succeeded

FOUND() --> lSuccess

INDEXEXT() : 

Return the default index extension

INDEXEXT() --> cExtension

INDEXKEY() : 

Return the key expression of a specified index

INDEXKEY( <nOrder> ) --> cKeyExp

INDEXORD() : 

Return the order position of the controlling index

INDEXORD() --> nOrder

ORDBAGEXT() :

Return the default Order Bag RDD extension

ORDBAGEXT() --> cBagExt

ORDBAGNAME() :

Return the Order Bag name of a specific Order

ORDBAGNAME(<nOrder> | <cOrderName>) --> cOrderBagName

ORDCOND()

Specify conditions for ordering

ORDCOND([FOR <lCondition>]
             [ALL] [WHILE <;lCondition>]
             [EVAL <bBlock> [EVERY <nInterval>]]
             [RECORD <nRecord>] [NEXT <nNumber>]
             [REST] [DESCENDING])

ORDCONDSET()

Set the condition and scope for an order

     ORDCONDSET([<cForCondition>],
        [<bForCondition>],
        [<lAll>],
        [<bWhileCondition>],
        [<bEval>],
        [<nInterval>],
        [<nStart>],
        [<nNext>],
        [<nRecord>],
        [<lRest>],
        [<lDescend>],
        [<lAdditive>],
        [<lCurrent>],
        [<lCustom>],
        [<lNoOptimize>]) --> lSuccess

ORDCREATE():

Create an Order in an Order Bag

ORDCREATE(<cOrderBagName>,[<cOrderName>], <cExpKey>,

    [<bExpKey>], [<lUnique>]) --> NIL

ORDDESCEND()

Return and optionally change the descending flag of an order

ORDDESCEND([<cOrder> | <nPosition>],[<cIndexFile>],
            [<lNewDescend>]) --> lCurrentDescend

ORDDESTROY() :

Remove a specified Order from an Order Bag

ORDDESTROY(<cOrderName> [, <cOrderBagName> ]) --> NIL

ORDFOR() :

Return the FOR expression of an Order

ORDFOR(<cOrderName> | <nOrder>
    [, <cOrderBagName>]) --> cForExp

ORDISUNIQUE()

          Return the status of the unique flag for a given order

    ORDISUNIQUE([<cOrder> | <nPosition>],
        [<cIndexFile>]) --> lUnique

ORDKEY() :

Return the Key expression of an Order

ORDKEY(<cOrderName> | <nOrder>
 [, <cOrderBagName>]) --> cExpKey

ORDKEYADD()

Add a key to a custom built order

         ORDKEYADD([<cOrder> | <nPosition>],
            [<cIndexFile>],[<expKeyValue>]) --> lSuccess

 

ORDKEYCOUNT()

Return the number of keys in an order

         ORDKEYCOUNT([<cOrder> | <nPosition>],
              [<cIndexFile>]) --> nKeys

ORDKEYDEL()

Delete a key from a custom built order

        ORDKEYDEL([<cOrder> | <nPosition>],
            [<cIndexFile>],
            [<expKeyValue>]) --> lSuccess

ORDKEYGOTO()

Move to a record specified by its logical record number

ORDKEYGOTO(<nKeyNo>) --> lSuccess

ORDKEYNO()

 Get the logical record number of the current record

         ORDKEYNO([<cOrder> | <nPosition>],
             [<cIndexFile>]) --> nKeyNo

 ORDKEYVAL()

Get key value of the current record from controlling order

ORDKEYVAL() --> xKeyValue

 

ORDLISTADD() :

Add Order Bag contents or single Order to the Order List

ORDLISTADD(<cOrderBagName>
    [, <cOrderName>]) --> NIL

ORDLISTCLEAR() :

Clear the current Order List

ORDLISTCLEAR() --> NIL

ORDLISTREBUILD() :

Rebuild all Orders in the Order List of the current work area

ORDLISTREBUILD() --> NIL

ORDNAME() :

Return the name of an Order in the work area

ORDNAME(<nOrder>[,<cOrderBagName>])
    --> cOrderName

ORDNUMBER() :

Return the position of an Order in the current Order List

ORDNUMBER(<cOrderName>[, <cOrderBagName>]) --> nOrderNo

 ORDSCOPE()

Set or clear the boundaries for scoping key values

ORDSCOPE(<nScope>, [<expNewValue>]) --> uCurrentValue

ORDSETFOCUS() :

Set focus to an Order in an Order List

ORDSETFOCUS([<cOrderName> | <nOrder>]
    [,<cOrderBagName>]) --> cPrevOrderNameInFocus

ORDSETRELAT()

Relate a specified work area to the current work area

    ORDSETRELATION(<nArea> | <cAlias>,<bKey>, [<cKey>])

             --> NIL

ORDSKIPUNIQUE()

Move record pointer to the next or previous unique key

ORDSKIPUNIQUE([<nDirection>]) –> lSuccess