EXCLUSIVE:
No, not if two users should be able to work on the data. Shared is the norm in runtime, exclusive in the IDE, as you more often need exclusive access to modify table structure or (re)index or zap (totally empty) or pack a table (remove rows marked deleted). So it's the developer mode. I personally made OFF the IDE setting, too. Because with it on it leads to writing code that only works in the IDE and not later at runtime, where you don't have that privilege anymore.
RELEASE:
No, this is for removing variables from memory, that's not for closing tables.
USE is both opening and closing a DBF file in a workarea. You can see that, if you USE two DBFs, the second USE closes the first one:
Open the data session window: SET.
Then
USE table1
USE table2
You end up with table2 opened.
USE
table2 is now closed. So you can even interpret USE as mainly meaning close whatever is open in a workarea. And then open something else, if something else is specified is secondary, not main feature. Well, of course it is, but you could always also use the visual data environment (DE) of a form and put your tables in there to have them opened. If you had forms and not screen code. Actually I prefer the code as it's clear in which order and makes everything else that could also be done in the visual DE clear to the reader including the order of processing.
For example, a script that USEs several tables sets up joins between them with SET RELATION and then opens up several BROWSE windows was a tool I used for a project manager to let him work on the data as directly as you can. But it's not really a fine UI for end-users.
And by the way, you open multiple tables via the special meaning of workarea 0. Unlike any other workarea number>0 it's not a specific workarea, just the next available unused workarea.
So you can either SELECT 0 and then USE some.dbf or you can USE some.dbf IN 0, then USE someother.dbf IN 0 and both are open.
The difference between these alternatives? If you USE something IN 0 it's opening in a workarea not used by something else before, but it doesn't become the actively selected workarea. If you SELECT 0 and USE a table you also have it selected already, as you actually select a workarea, not a dbf file. SELECT 0 already does SELECT a specific workarea and that stays the selected workarea no matter what you open in it.
Unless you SELECT something else.
It's still the only case where it's okay - in my opinion - to use a workarea number. You might find a lot of working in specific workarea numbers in your legacy code, as before VFP3 there only were 15 at max, so you organized and used them well, not randomly. The concept of names for workareas is much more convenient to write understandable somewhat self-documenting code, though, as you don't have to remember which number means which table. But be aware that you can only SELECT <db or table> as the automatic alias naming of workareas is to get the file name (without dbf extension) as workarea name. It's not the same, though!
Useful to know, too:
CLOSE TABLES ALL - closes all workareas
CLOSE DATABASES ALL - closes all DBCs and tables, too
CLEAR ALL - often thought of as an analogy of CLOSE TABLES ALL to memory variables, but indeed releases and closes a lot of things including all tables currently open.
So these create something like an empty tidy desk you can start from, again. You might find these nowhere in start code as that's the norm to start with anyway, but it's helpful if you're stuck in the IDE and want everything to go away and start fresh without exiting and restarting VFP.
Take it with a pinch of salt, though, as some helpful frameworks used for application development load themselves at VFP startup and establish some objects and hooks in memory that are removed by CLEAR ALL, too. But I don't think this affects you, your legacy project seems not to use any framework I think of. I don't even know a legacy application framework at all.
Bye, Olaf.
Olaf Doschke Software Engineering