Compartilhar via


ALIAS( ) Function

Returns the table alias of the current or specified work area.

ALIAS([nWorkArea | cTableAlias])

Return Values

Character

Parameters

  • nWorkArea
    Specifies the work area number for which ALIAS( ) returns the table alias.

  • cTableAlias
    Specifies the table alias for which ALIAS( ) returns the table alias.

    If you omit nWorkArea or cTableAlias, ALIAS( ) returns the alias of the table open in the current work area. An empty string is returned if a table isn't open in the current or specified work area.

Example

The following example opens the customer table and displays its alias. The customer table is opened again in another work area, is assigned an alias of MyCustomer, and the alias is displayed.

CLOSE DATABASES
OPEN DATABASE (HOME(2) + 'Data\testdata')
USE customer     && Open customer table
CLEAR
? ALIAS( )  && Display the alias
SELECT 0
USE customer AGAIN ALIAS MyCustomer  && Different alias
? ALIAS( )  && Display the alias

See Also

DBF( ) | SELECT( ) | Working with Table Aliases | Alias Property