Jim-
I just did a quick test.
use dataprg\bbonein
sele 0
use main!vwpairin
dime x[1]
y=aused(x)
After this, y = 3 (bbonein, vwpairin, and the other table involved in the view), and the array's elements are: Element 1 = vwpairin (WA=2); 2 = nopair (WA=3); and 3 = bbonein (WA=1).
So, you can't count on the sort, that's for sure. Also, the array gives what you are looking for.
use dataprg\bbonein
sele 0
use main!vwpairin
dime x[1]
y=aused(x)
FOR lni = 1 TO ALEN( x, 1 )
IF DBF( x[lni,1] ) = cDBF
*!* then exit and do whatever
lnArea = x[lni,2]
EXIT
ENDIF
NEXT lni
HTH
>>>Thank you to all who replied.
>>>
>>>Looks like the AUSED() function is the hands down winner for finding the highest "used" workarea. Testing it several ways, it looks like AUSED() does create an array that is already in descending order with the highest used workarea in row 1 of the array.