Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- FlexFile Reference Guide - <b>v_select()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 V_SELECT()
 Determine or select the DBV work area of a specified DBV alias
-------------------------------------------------------------------------------

    V_SELECT( [<nNewArea>] | [<cAlias>] )      nOldArea

 Arguments

    <nNewArea> or <cAlias> is the new DBV area (or the new area
    associated with <cAlias>).

 Returns

    V_SELECT() returns the old area if the area is successfully
    changed or if no parameters are passed. On error (i.e. an area
    beyond the bounds of the V_FILES() setting), V_SELECT() will
    return a 0 and the DBV area will remain unchanged.

 Description

    V_SELECT() provides the functionality of a combination of
    Clipper's SELECT command and SELECT() function.  Specifically, it
    is used to change and/or fetch the active DBV work area.

    If no parameters are passed V_SELECT() parallels the Clipper
    SELECT() by returning the current DBV area. If, however, a valid
    DBV area or alias is passed, V_SELECT() will change the current
    DBV area as Clipper's SELECT command would and then returns the
    old DBV area as Clipper's SELECT() function would.  This
    functionality is slightly different than Clipper's SELECT() which
    returns the area of the alias but does not actually change the
    selected area.  If you need to test for the existance of an open
    file in a DBV work area, use the V_ISOPEN() function.

    V_SELECT() always returns a DBV area number regardless of whether
    the parameter passed was an alias or an area.

 Notes

  . Do not confuse Clipper's selected work area with FlexFile's;
    they are mutually exclusive. For example, you can have a DBF file
    open in area 2 and simultaneously have a DBV file open in
    V_SELECT() == 2. Likewise, SELECT <n> has no effect on the
    currently selected DBV area.

  . Remember that your maximum number of open files must be set by
    the V_FILES() function before V_USE()in your first DBV file. The
    valid DBV areas will then be from 1 to the value you passed to
    V_FILES(). See V_FILES() for more on defining the maximum number
    of work areas.

 Examples

    // Open three DBV files in three new areas.
    LOCAL nSelect

    nSelect = V_SELECT(1)    // Save current area and
                             // select area 1
    V_USE( "file1", "file_one" )// Creates if not existing
    V_SELECT(2)
    V_USE( "file2" )
    V_SELECT(0)              // Select the next area
    V_USE( "file3" )

    ? V_ALIAS()              //  Returns: FILE3
    ? V_ALIAS(1)             //  Returns: FILE_ONE

    V_SELECT( nSelect )      // Restore the first area.

See Also: V_ALIAS() V_USE() V_ISOPEN() V_FILES()

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