Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to keep track of opened cursors
Message
 
À
09/11/2001 11:28:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00579695
Message ID:
00579715
Vues:
22
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.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform