Determines if an alias is in use or a table is open in a specific work area.
USED([nWorkArea | cTableAlias]) |
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 area; otherwise false (.F.) is returned.
Return Value
Logical
Remarks
USED( ) can determine if an alias is in use or if a table is open in a specific work area.
Example
Copy Code | |
|---|---|
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
Reference
ALIAS( ) FunctionSELECT( ) Function
AUSED( ) Function
Other Resources
FunctionsLanguage Reference (Visual FoxPro)
Microsoft Visual FoxPro 9 SP2 Help file, VFPX Edition v1.08