General information
Category:
Coding, syntax & commands
Good idea...thanks!
>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.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only