Information générale
Catégorie:
Codage, syntaxe et commandes
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement