At 02:50 2015-07-18, Alan Bourke <[email protected]> wrote:
Just keep a list of the aliases you used when you opened the tables, say
in an array aTables, or a collection,and when you want to close them
iterate through the list and do something like:
for i = 1 to alen(aTables, 1)
use in select(aTables[i])
endfor
If the alias is opened, it'll close it. If not, no errors or anything
will happen, it will just continue. No type checking or any further
complication required.
I do use your approach when the list of tables can vary and
tables are opened in different places, but setting up that list adds
to the complexity of the code. I usually write something like:
select clcode,clname from ccli;
where ccli in (select wonbr from cwko where wostatus in ("A","R");
order by clcode
closeforsql("ccli")
closeforsql("cwko")
Sincerely,
Gene Wirchenko
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.