>>Hi all;
>>
>>I want to know if a given cursor in a given datasession exists. What is the optimal/fastest way to do this in code?
>>
>>TIA
>
>You can use AUSED(ArrayName [, nDataSessionNumber [, cTableName]]) and then search in the array (if you did not pass cTableName)
>
>[update]
>Well, I guess you will always pass cTableName, silly me
Something like:
? inUSe('c:\vfp\mytable.dbf', 2)
function inUse
lparameters tcTableName, tnDS
local laInfo(1)
return aused(laInfo, tnDS, tcTableName) > 0
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?
"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare
"To die for a religion is easier than to live it absolutely"
Jorge L. Borges