Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- SIx Driver RDD v3.00 - Reference Guide - <b>sx_setscope():</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  Sx_SetScope():

  Syntax:   Sx_SetScope( [nWhich, [xValue]] )

            nWhich = Value identifying which scope value to set
                     (0 = TOP, 1 = BOTTOM)
            xValue = Value to set as top or bottom of scope

  Returns:   <?> Current value for the specified scope position (top/bottom).
                  If no scope is active for the specified, NIL is returned.

  Description:    This function sets/returns the specified scope value for
                  the current tag or index.  nWhich is used to identify
                  which value to set or return.

                     0 = SCOPETOP     (default)
                     1 = SCOPEBOTTOM

                  xValue must be the same data type as the index key.

                  xValue specifies the high/low boundary values to
                  establish the range of available keys within the current
                  index.  This allows you to set a scope smaller than the
                  current index without creating a conditional index file.

                  The scope is designed to emulate the actual TOP and
                  BOTTOM of the current index.  This means that descending
                  indexes will have a higher SCOPETOP value than
                  SCOPEBOTTOM value.

                  The specified scope is active as soon as the record
                  pointer is repositioned using GO TOP, GO BOTTOM
                  or SKIP.  Using GOTO will allow the record
                  pointer to be positioned outside the active scope.

                  The specified scope is identified with the current index
                  or tag and remains in effect until the scope is cleared
                  (using Sx_ClrScope(), CLEAR SCOPE or SET
                  SCOPETOP TO and SET SCOPEBOTTOM TO) or the index
                  is closed.

                  Sx_SetScope() is used in the following commands:

                      SET SCOPETOP TO
                      SET SCOPEBOTTOM TO
                      SET SCOPE

    NOTE:  This function is NOT supported under SIXNTX.

  Example:

    #include "SIXCDX.CH"

    USE test VIA "SIXCDX        // Open TEST.DBF
    INDEX ON state TAG state    // Create an index on the AGE field
    Sx_SetScope( 0, "AZ" )      // Sets the top SCOPE value to "AZ"
    Sx_SetScope( 1, "CA" )      // Sets the bottom SCOPE value to "CA"
    GO TOP                      // Move to top of scope
    Browse()                    // Browse all records w/ states from AZ-CA
    Sx_ClrScope(0)              // Clear SCOPETOP
    Sx_ClrScope(1)              // Clear SCOPEBOTTOM


  NOTE: The SET SCOPE command will set both the SCOPETOP and SCOPEBOTTOM
        values to the same value.

  ANOTHER NOTE:  The CLEAR SCOPE command is equivalent to calling
                 Sx_ClrScope(0) and Sx_SxClrScope(1).

  YET ANOTHER NOTE:  See the SCOPE.PRG program for a more detailed, practical
                     example.



See Also: Sx_ClrScope() CLEAR SCOPE SET SCOPE SET SCOPETOP / SET SCOPEBOTTOM

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson