Condividi tramite


USED( ) Function

Determines if an alias is in use or a table is open in a specific work area.

USED([nWorkArea | cTableAlias])

Return Values

Logical

Parameters

  • nWorkArea | cTableAlias
    Specifies a table's work area or alias. USED( ) returns a logical true (.T.) if a table is opened in the work area you specify with nWorkArea; otherwise a logical false (.F.) is returned. USED( ) returns a logical true (.T.) if an alias is in use with the alias you specify with cTableAlias; otherwise false (.F.) is returned.

    If you omit nWorkArea and cTableAlias, USED( ) returns a logical true (.T.) if a table is open in the currently selected work; otherwise false (.F.) is returned.

Remarks

USED( ) can determine if an alias is in use or if a table is open in a specific work area.

Example

CLOSE DATABASES
OPEN DATABASE (HOME(2) + 'Data\testdata')
SELECT A
USE customer  && Opens Customer table
SELECT B
USE orders  && Opens Orders table
SELECT C
USE employee  && Opens Employee table
? USED('A')  && Displays .T.
? USED('B')  && Displays .T.
? USED(4)  && Displays .F.

See Also

ALIAS( ) | SELECT( ) | AUSED( )