C5_DBSELECTAREA

 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()



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.