Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper 5.3 . Guide To CA-Clipper - <b>dbselectarea()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 DBSELECTAREA()
 Change the current work area
------------------------------------------------------------------------------
 Syntax

     DBSELECTAREA(<nArea> | <cAlias>) --> NIL

 Arguments

     <nArea> is a numeric value between zero and 250, inclusive, that
     specifies the work area being selected.

     <cAlias> is a character value that specifies the alias of a
     currently occupied work area being selected.

 Returns

     DBSELECTAREA() always returns NIL.

 Description

     DBSELECTAREA() causes the specified work area to become the current work
     area.  All subsequent database operations will apply to this work area
     unless another work area is explicitly specified for an operation.
     DBSELECTAREA() performs the same function as the standard SELECT
     command.  For more information, refer to the SELECT command.

 Notes

     .  Selecting zero: Selecting work area zero causes the lowest
        numbered unoccupied work area to become the current work area.

     .  Aliased expressions: The alias operator (->) can temporarily
        select a work area while an expression is evaluated and automatically
        restore the previously selected work area afterward.  For more
        information, refer to the alias operator (->).

 Examples

     .  The following example selects a work area via the alias name:

        cLast := "Winston"
        DBUSEAREA( .T., "DBFNTX", "Sales", "Sales", .T. )
        DBSETINDEX( "SALEFNAM" )
        DBSETINDEX( "SALELNAM" )
        //
        DBUSEAREA( .T., "DBFNTX", "Colls", "Colls", .T. )
        DBSETINDEX( "COLLFNAM" )
        DBSETINDEX( "COLLLNAM" )
        //
        DBSELECTAREA( "Sales" )      // select "Sales" work area
        //
        IF ( Sales->(DBSEEK(cLast)) )
           IF Sales->( DELETED() ) .AND. Sales->( RLOCK() )
              Sales->( DBRECALL() )
              ? "Deleted record has been recalled."
           ENDIF
        ELSE
           ? "Not found"
        ENDIF

 Files   Library is CLIPPER.LIB.


See Also: DBUSEAREA() RLOCK() UNLOCK SELECT SELECT() RLOCK()

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