Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Closing Cursor
Message
From
01/08/2008 17:11:50
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
01/08/2008 04:19:16
Luis Santos
Biglevel-Soluções Informáticas, Lda
Portugal
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Database:
MS SQL Server
Miscellaneous
Thread ID:
01335447
Message ID:
01335975
Views:
16
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform