Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GETENV('WINDIR') Returns Empty in XP
Message
 
To
26/12/2001 09:49:18
General information
Forum:
Visual FoxPro
Category:
Installation, Setup and Configuration
Miscellaneous
Thread ID:
00597007
Message ID:
00598210
Views:
25
>George,
>
>Thanks for the information. 'GetSystemDirectory' worked well. I am still puzzled about why getenv('WINDIR') returns empty on a Windows XP system.
>
>Bill Schenck

Bill,

I'd assume it would be because the environment variable wasn't/isn't set in XP. The GETENV() function maps to an API call named GetEnvironmentVariable(). To test this theory, you could try the following
DECLARE INTEGER GetEnvironmentVariable IN Win32API;
  STRING @lpName, STRING @lpBuffer, INTEGER nSize
lcname = 'WINDIR'
lnsize = 260
lcbuffer = SPACE(lnsize)
lnsize = GetEnvironmentVariable(@lcname, @lcbuffer, lnsize)
IF lnsize > 0
  ? LEFT(lcbuffer, lnsize)
ELSE
  ? lcname + " not found!"
ENDIF
George

Ubi caritas et amor, deus ibi est
Previous
Reply
Map
View

Click here to load this message in the networking platform