>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.