xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

Alias()

Returns the alias name of a work area.

Syntax

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

Arguments

<nWorkArea>
<nWorkArea> is the numeric ordinal position of a work area. Work areas are numbered from 1 to 65535.

Return

The function returns the alias name of the work area specified with <nWorkArea>. If no parameter is passed, the alias name of the current work area is returned. When no database is open in the work area, the return value is a null string ("").

Description

The alias name of a work area exists while a database is open in it. Alias names are used to address work areas via a symbolic name and are specified with the USE command or the DbUseArea() function. Alias names are always created in upper case letters.

Info

See also:DbInfo(), DbUseArea(), OrdName(), OrdNumber(), SELECT, Select(), USE
Category: Database functions
Source:rdd\dbcmd.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example demonstrates usage of functions Alias() and Select(),
// both ofwhich are used to address work areas.

   PROCEDURE Main
      USE Customer NEW ALIAS Cust
      USE Invoice  NEW ALIAS Inv

      ? Alias()                        // result: INV
      ? Select()                       // result: 2

      ? Alias(1)                       // result: CUST
      ? Select( "CUST" )               // result: 1

      CLOSE ALL
   RETURN

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