Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
If a table name is a varible ,How to judge it be used()
Message
De
11/06/2002 16:18:29
 
 
À
11/06/2002 12:11:41
Irv Adams
MSC Managed Care, Inc.
Floride, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00666937
Message ID:
00667078
Vues:
31
Opening the table with a uniform alias won't work if you call the routine more than once with different tablenames. An alternative is to grab all current aliases with aused() and check the dbf() for a match. eg:

=aused(laCurtables)
for each cTableAlias in laCurtables
if juststem(dbf(cTableAlias))=tablename && it's in use
llused=.t.
exit
endif
endfor
if !llused
use (tablename) again in 0
endif


>Doug's answer is correct, and also don't use the Extension (.DBF) in the USED() command; it is expecting just the Alias name. (I'm not sure from your question but it looked as if you may have been tacking on the "DBF" part...)
>
>-Irv.
>
>
>>Hello everyone:
>> If a table name is a varible ,How to judge it be used().
>> For example:
>>public theyear ,themonth, tablename
>>theyear=''2002''
>>themonth=''06''
>>tablename=''''
>>
>>tablename=allt(theyear)+''Äê''+allt(themonth)+''ÔÂ''
>>if not used(tablename)
>>....
>>endif
>>
>>In fact this code is failure ,Could you give me some advice?
>>Thank you.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform