AUSED( ) Function

Places table aliases and work areas for a data session into a variable array.

AUSED(ArrayName [, nDataSessionNumber])

Return Values

Numeric

Parameters

  • ArrayName
    Specifies the name of the array containing the table aliases and work areas for a data session. If the array you specify doesn't exist, Microsoft Visual FoxPro automatically creates the array. If the array exists and isn't large enough to contain all the table aliases and work areas, Visual FoxPro automatically increases the size of the array. If the array is larger than necessary, Visual FoxPro truncates the array. If the array exists and AUSED( ) returns 0 because no tables are open in the data session, the array remains unchanged. If the array doesn't exist and AUSED( ) returns 0, the array isn't created.
  • nDataSessionNumber
    Specifies the data session number for which AUSED( ) returns the table aliases and work areas. If you omit nDataSessionNumber, AUSED( ) returns information about the current data session. Use SET DATASESSION to specify the current data session.

Remarks

AUSED( ) returns the number of rows in the array, which is identical to the number of tables open in the data session.

AUSED( ) creates a two-dimensional array and places the aliases of tables open for the data session in the first column of the array. The second column of the array contains the tables' corresponding work area numbers.

Example

The following example uses AUSED( ) to create an array named gaInuse that contains the table aliases and work areas for tables open in the current data session. The number of open tables for the current data session is displayed, and the table aliases and work areas are then displayed.

OPEN DATABASE (HOME(2) + 'Data\testdata') EXCLUSIVE
USE Customer IN 0
CLEAR
? AUSED(gaInuse)
DISPLAY MEMORY LIKE gaInuse
CLOSE DATABASES

See Also

ALIAS( ) | SET DATASESSION | USE | Working with Table Aliases