Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Compact closes
Message
From
14/08/1998 14:59:47
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00125767
Message ID:
00126994
Views:
28
>>
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.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform