Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Get user name from network
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00275384
Message ID:
00275799
Vues:
30
>>ALLTRIM(SUBSTR(SYS(0),ATC('#',SYS(0))+1,LEN(SYS(0))))
>>
>>I *think* this will always work in a network environment, though you might want to check for a '0' result (I think it is) to ensure there's been a login.
>
>Hi Bruce,
>
>I'd first assign SYS(0) to a variable. This would eliminate three function calls in the above. Further, I'd simplify it to:
>
>lcuser = SYS(0)
>lcuser = ALLTRIM(SUBSTR(lcuser, ATC('#', lcuser) + 1))

Yes, I've already thought about using a local, though it's instantaneous even without it...

>There's no need to provide a length for SUBSTR() since it will take whatever remains of the string if it isn't provided.

As I recall, that's dependent on a SET something. Since I'm turning these off & on a lot during loading, I thought it safer to to be explicit...Do you recall what I'm referring to?
The Anonymous Bureaucrat,
and frankly, quite content not to be
a member of either major US political party.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform