Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
System Environment Variable
Message
 
À
02/10/2002 18:32:47
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00707146
Message ID:
00707153
Vues:
16
>How can I return a value that is held in a System Environment variable? I need to get the value in Username.
>
Judy,

GETENV() can return this information provided the computer is logged into a network. So can SYS(1). However, best is probably
DECLARE INTEGER WNetGetUser IN Win32API;
  STRING @lpName, STRING @lpUserName,;
  INTEGER @lpnLength
lcname = "F:"
lcuser = SPACE(260)
lnsize = LEN(lcuser)
IF WNetGetUser(@lcname, @lcuser, @lnsize) = 0
  ? LEFT(lcuser, lnsize)
ENDIF
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform