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 "t
cTable, t
cOrder" 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","")
>>>if !used(lcAlias)
>>> use (tcTable) in 0
>>>endif
>>>select (lcAlias)
>>>if parameters()=2
>>> set order to tag ;
>>> (iif(type("tcOrder") = "N", ;
>>> tag(tcOrder), tcOrder))
>>>
>>>endif
Cetin