Hello,
How can I retrieve the %USERPROFILE%\Local Settings\Application Data directory?
Thanks,
Marc
GETENV("USERPROFILE")
*------------------------*
Function GetEnv(VarString)
Local OutBuf:=space(200),VarLen:=0
VarLen:=GetEnv2(ALLTRIM(VarString),Outbuf,200)
* If the value return is greater than the initial buffer we have to increase
* it to receive the value but I limit the length to 3000
if VarLen > 200 .and. VarLen <=3000
Outbuf:=SPACE(VarLen)
GetEnv2(ALLTRIM(VarString),Outbuf,Varlen)
elseif VarLen > 3000
MSGINFO("Can't retrieve, the value is too long")
VarLen:=0
endif
Return Left(OutBuf,Varlen)
DLL32 FUNCTION GetEnv2( lpName AS LPSTR, lpBuffer AS LPSTR, nSize AS DWORD) ;
AS DWORD PASCAL FROM "GetEnvironmentVariableA" LIB "Kernel32.DLL"
Return to FiveWin for CA-Clipper
Users browsing this forum: No registered users and 0 guests