Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to keep track of opened cursors
Message
 
To
09/11/2001 11:28:05
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00579695
Message ID:
00579715
Views:
21
Hi,

I do it in a not so elegant way but it works for me. I check if the alias in a work area will return a .T. if I check if it is also a DBF file.
?FILE(ALIAS() + ".DBF")
One rule we use though is that cursors are not named the same as tables :)

HTH,
Arriyel

>Hi,
>
>I want to keep track of the cursors currently opened in my working environment. Problem is, some of the were built using a query:
>
>SELECT * FROM myTable INTO CURSOR crsMyCursor
>
>I tried the following code to list all my opened cursors:
>
<CODE>LOCAL lnPos, lnFile
>
>lnFile = FCREATE("C:\debug_cursors.txt")
>
>IF lnFile = -1 THEN
>	RETURN
>ENDIF
>
>lnPos = 1
>DO WHILE USED(lnPos)
>	FWRITE(lnFile, ALIAS(lnPos) + CHR(13) + CHR(10))
>	lnPos = lnPos + 1
>ENDDO
>
>FCLOSE(lnFile)</CODE>
>
>It's fairly simple but it only lists the opened tables in my environment (the ones I opened using the 'USE' keyword). I have also taken a look at all the 'DISPLAY ...' and 'LIST ...' possibilities but none of them do what I want.
>
>So, how can I quickly list all of the opened cursors in a specified working session?
>
>Thanks in advance, Stephane.
>
>P.S. In the future, I will probably create my cursors using a method that will store the names of all the opened cursors in an array. But for now, since the application is almost fully completed, I'd like another solution...
Speak using soft and sweet words in case you have to eat them later.
Previous
Reply
Map
View

Click here to load this message in the networking platform