Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Closing Cursor
Message
De
01/08/2008 17:11:50
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
À
01/08/2008 04:19:16
Luis Santos
Biglevel-Soluções Informáticas, Lda
Portugal
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Database:
MS SQL Server
Divers
Thread ID:
01335447
Message ID:
01335975
Vues:
17
>Hello Tore
>
>Thanks for your reply , also i have a dought:
>when i write
>
>use curs1 in 0
>i think that i place the cursor on determinate memory area, if after running my code if i write " use in curs1" the same one closed?

When you say "use ... in 0", it means "first free workarea". However, "use in {alias}" means "open nothing in workarea with the given alias - effectively closing whatever is there. You could say "use {table2} alias {alias2} in {alias1}" which would open table2 under alias2 in the workarea occupied by alias2... however, both of these would break if there's nothing open with that alias.

The safe way, if you are not quite sure that there will be anything open under that alias, is to say

use in select("myalias")

and if myalias is not in use, select("myalias") will return zero, and you will have "use in 0" - open nothing in first free workarea, i.e. close what wasn't open anyway. Sounds a bit convoluted, I know, but many people do it that way. Simpler than to write code to check whether it's open, or to write error handling.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform