xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

Select()

Retrieves the work area number by alias name.

Syntax

Select( [<cAlias>] ) --> nWorkArea

Arguments

<cAlias>
A character string holding the alias name of the work area to select as current.

Return

The function returns an integer numeric value representing the work area number of the work area having the alias name <cAlias>. If this alias does not exist, the return value is zero. When <cAlias> is omitted, the function returns the work area number of the current work area.

Description

Select() retrieves the work area number by its alias name. This is the opposite of function Alias(), which retrieves the alias name of a work area by its number.

Work areas are numbered from 1 to 65535. They hold open database and index files and make them accesible to database functions and commands.

Info

See also:Alias(), DbSelectArea(), FieldGet(), SELECT, USE, Used()
Category: Database functions
Source:rdd\dbcmd.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example opens two databases in two different work areas
// shows their work area numbers.

   PROCEDURE Main
      USE Customer ALIAS Cust

      DbSelectArea(10)
      USE Invoice ALIAS Inv

      ? Select()                       // result: 10
      ? Select( "Cust" )               // result:  1
      ? Select( "Inv" )                // result: 10

      CLOSE ALL
   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe