Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
System Environment Variable
Message
 
To
02/10/2002 18:32:47
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00707146
Message ID:
00707153
Views:
15
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform