DBF SELECT()

From Recital Documentation Wiki
Revision as of 17:17, 27 March 2009 by Yvonnemilne (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

PURPOSE

Select a workarea


SYNONYM

api_dbf_select()


SYNOPSIS

#include "dbapi.h"
 
int	DBF_SELECT(workarea)
 
<input parameters>
int	workarea;		/* Workarea to select	*/
 
<output parameters>
none


DESCRIPTION

The DBF_SELECT() function will select the specified workarea.

Recital provides you with 100 workareas by default, however, up to 256 may be set with the DB_MAXWKA environment variable / symbol.

Each workarea contains the context for the database which has been opened in that workarea, including: the current record pointer, the current record, the current record buffer, the format file, the index files, the filter condition, and the relationships to other workareas.


EXAMPLE

The following example selects the workarea specified in the first parameter passed.

#include "dbapi.h"
 
dbapi_dbf_select()
{
    int	rc;
 
    if (_parinfo(1) == API_NTYPE) {
       rc = DBF_SELECT(_parni(1));
    } else {
       rc = -1;
    }
 
    _retni( rc );
}


SEE ALSO

DBF_ALIAS(), DBF_DBF(), DBF_USED()