Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
IF USED()=.F. OPEN else SELECT the Table (Foxpro 2.5b)
Message
 
To
07/03/2000 11:30:00
General information
Forum:
Visual FoxPro
Category:
FoxPro 2.x
Miscellaneous
Thread ID:
00341636
Message ID:
00343095
Views:
25
Je vois.. je viens de vérifier dans la "naming" convention des variables.

Mais n'y a-t-il pas risque de confusion, t pour parameter et t pour Datetime..!?


>Le 't' signifie que cette variable est un paramètre.
>'t' means parameter.
>
>
>>Hi Cetin,
>>
>>Thank you for your reply.
>>
>>As first sight it seems like it does exactly what I was looking for.
>>Is this a routine you are using yourself?
>>
>>I'll put more time on it as soon as I can and let you know.
>>
>>Tell me, in "tcTable, tcOrder" the left c convention is for caracter variable. Is the t for table?
>>
>>Réal
>>
>>>
There are many ways to do :) As I understand you use either fullpath or just filename as _DBF. Used() checks for alias not fullpath so if it's in another dir (fullpath supplied) it fails. If you don't need a very robust version (e.g. taking into consideration that a table could be opened multipl times all with different alias names other than filename, filenames are not LFN etc) then this one works :
>>>
function myUse
>>>parameters tcTable, tcOrder
>>>lcAlias = strtran( ;
>>>     iif(at("\",tcTable)>0, ;
>>>        substr(tcTable,rat("\",tcTable)+1), ;
>>>        tcTable), ;
>>>     ".dbf","")     && Strip just alias
>>>if !used(lcAlias)
>>>	use (tcTable) in 0 && Fox automatically assigns filename as alias
>>>endif
>>>select (lcAlias)
>>>if parameters()=2
>>>   set order to tag ;
>>>      (iif(type("tcOrder") = "N", ;
>>>      tag(tcOrder), tcOrder))
>>>      && If tcOrder is numeric get tagname else use tcOrder
>>>endif
Cetin
Réal Philippon
www.ultra.ca
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform