Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
If a table name is a varible ,How to judge it be used()
Message
From
11/06/2002 16:25:31
Irv Adams
MSC Managed Care, Inc.
Florida, United States
 
 
To
11/06/2002 16:18:29
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00666937
Message ID:
00667083
Views:
28
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
Map
View

Click here to load this message in the networking platform