Thanks Hugo for pointing me to the Aused function which is very handy.
>>>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
>