It is not essential to close the table, as it will be closed automatically when the application terminates. However, many programmers like to close tables as soon as they finish using them -- I guess they like being tidy (and there is also a small risk that if the application crashes while the table is open, the table or its indexes could become corrupted).
If you do decide to close the table explicitly, Chris's code will do it for you.
The use by itself will close the current work area.
To add to what Mike said, I usually open my main system table(s) right off that bat and take any io hit them. I leave them open unless I need to use them exclusively later.
I open and close support tables, that are unique to a specific routine, as the routine is accessed.
Open and closing tables is one of the slowest VFP operations so you don't want to do it a lot, but on the other hand you don't want a bunch of file handles open. It is a fine line you have to walk.
i agree with the tipmasters. as for me, i usually close my tables using sir chris's code (USE IN TableAlias). it's easier to see which tables are closed and which are still open coz kinda confusing when you use several tables in different working areas at a single time.
kilroy
philippines "and that's what we call creativity..."
I personally use a tip that I got from MikeLewis some time back...
Use In Select("MyAlias"
...it always closes the correct alias, unless that alias isn't open in one of the work areas and then it won't even throw an error. It is the best way of doing this I've found so far. There are times however when you would want it to throw an error so you knew something was wrong I guess.
Slighthaze = NULL craig1442@mchsi.com
"Whom computers would destroy, they must first drive mad." - Anon
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.