ALIAS( ) Function

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

ALIAS([nWorkArea | cTableAlias])

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.

Return Value

Character

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

Tasks

How to: Create and Use Table Aliases

Reference

DBF( ) Function

SELECT( ) Function

Alias Property

Other Resources

Functions

Language Reference (Visual FoxPro)