AUsed()
With 32,767 work areas per data session, knowing what table is open in which work area is a significant task. AUSED() makes it simple by filling an array with a list of aliases and work areas for the current (or a specified) data session.
Usage |
nUsedCount = AUSED( ArrayName [, nDataSession ] ) |
Parameter |
Value |
Meaning |
ArrayName |
Name |
The array to be filled with alias and work area information. |
nDataSession |
Omitted |
Get aliases and work areas for the current data session. |
Positive Number |
Get aliases and work areas for the specified data session. |
|
nUsedCount |
Positive Number |
The number of rows in the array, equal to the number of work areas in use in the data session or the number of open databases. |
0 |
No work areas in use. |
Example |
? AUSED(aAliases) && create an array with aliases for the && current data session ? AUSED(aAliases, 3) && create an array with aliases for data && data session 3 |
* get "Before" listing nBeforeCnt = AUSED(aBefore) * do the query here * hold work area for result nResultArea = SELECT() * get "After" listing nAfterCnt = AUSED(aAfter) * now loop through changes, if any IF nAfterCnt > nBeforeCnt FOR nPointer = 1 TO nAfterCnt-nBeforeCnt * Start from 1 because most recently opened * come first IF aAfter[nPointer,2] <> nResultArea USE IN aAfter[nPointer,2] ENDIF ENDFOR ENDIF
See Also |
ADatabases(), Array Manipulation, Select-SQL, Set DataSession, Use, Used() |