Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Compact closes
Message
De
14/08/1998 14:59:47
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00125767
Message ID:
00126994
Vues:
31
>>
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform