Hi Fabio!
I SELECT(0) to create the first cursor and SELECT(1) to pick the WA to move it to so it's HIGHLY unlikely I would ever encounter this problem but thanks for pointing out a potential Gotcha!
>>>
ATTENTION, if the cursor it is created into the particular WA,
this code fails !
CLOSE TABLES ALL
CREATE CURSOR W1 (A i)
CREATE CURSOR W2 (A i)
SELECT 0
? 'WHERE THE CURSOR IT IS CREATED',SELECT()
CREATE CURSOR crs_at3_temp (fname c(1))
USE DBF("crs_at3_temp") AGAIN IN 3 ALIAS crs_at3
USE
? SELECT("crs_at3")
USE IN 3
solution:
#DEFINE PARTICULARWA 3
SELECT 0
CREATE CURSOR 'crs_at3'+IIF(SELECT()=PARTICULARWA,'','_') (fname c(1))
IF SELECT()#PARTICULARWA
USE DBF() AGAIN IN PARTICULARWA ALIAS crs_at3
USE
ENDIF
>>>