>>
procedure CloseTables( pcTable1, pcTable2... pcTableN )
>>local i, lcStr
>>for i = 1 to pcount()
>> lcStr = "pcTable" + alltrim( str( i ) )
>> select &lcStr
>> use
>>endfor
>>return
>
>Now there's a cool idea. How do I set it up when I don't know how many paramaters I'll be sending it? I'm guessing that "pcTable2... pcTableN" is just shorthand and not what I actually should use.
>
I use this:
Procedure CloseEm
Lpara lcList
#define c_comma ","
Local i, lcAlias
FOR i=1 TO words(lcList, c_comma)
lcAlias=wordnum(lcList, i, c_comma)
IF USED(lcAlias)
USE IN (lcAlias)
ENDIF
ENDFor
Actual function (this is a shortie) has more housekeeping to do, because it accepts "ALL" as a parameter (default if parameter omitted), and then it CLOSEs ALL, but unfortunately it closes the classlibs too, so it has to reopen them. Words() and WordNum() are from Foxtools.fll.