FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for CA-Clipper Local Settings\Application Data directory
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Local Settings\Application Data directory
Posted: Mon Jun 25, 2007 05:41 PM

Hello,

How can I retrieve the %USERPROFILE%\Local Settings\Application Data directory?

Thanks,
Marc

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Local Settings\Application Data directory
Posted: Wed Jun 27, 2007 03:43 AM
Dear Marc,

You can use GetEnv() as in Clipper function.

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"
Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)
Posts: 1195
Joined: Mon Oct 17, 2005 05:41 AM
Local Settings\Application Data directory
Posted: Wed Jun 27, 2007 05:11 AM

Thanks Dutch,

Its's working!!

Regards,
Marc

Regards,

Marc



FWH32+xHarbour | FWH64+Harbour | BCC | DBF | ADO+MySQL | ADO+MariaDB | ADO+SQLite
Posts: 1598
Joined: Fri Oct 07, 2005 05:56 PM
Local Settings\Application Data directory
Posted: Wed Jun 27, 2007 06:59 PM

Cheer!
My pleasure,
Dutch

Regards,

Dutch



FWH 2304 / xHarbour Simplex 1.2.3 / BCC73 / Pelles C / UEStudio

FWPPC 10.02 / Harbour for PPC (FTDN)

ADS V.9 / MySql / MariaDB

R&R 12 Infinity / Crystal Report XI R2

(Thailand)

Continue the discussion