Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
GETENV('WINDIR') Returns Empty in XP
Message
 
À
26/12/2001 09:49:18
Information générale
Forum:
Visual FoxPro
Catégorie:
Installation et configuration
Divers
Thread ID:
00597007
Message ID:
00598210
Vues:
26
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform