Code: Select all
METHOD GetString(cSection, cEntry)
LOCAL ptrBuffer AS PTR
LOCAL cValue AS STRING
ptrBuffer := MemAlloc(INI_STRING_LEN)
GetPrivateProfileString(String2Psz(cSection), String2Psz(cEntry), String2Psz(" "), PSZ( _CAST, ptrBuffer ), INI_STRING_LEN, String2Psz(SELF:fullPath))
cValue := Psz2String(PSZ(_CAST, ptrBuffer))
MemFree(ptrBuffer)
RETURN cValue
Code: Select all
METHOD GetSection(cSection) CLASS IniFile
LOCAL cBuffer AS STRING
LOCAL ptrBuffer AS PTR
LOCAL nLen AS DWORD
ptrBuffer := MemAlloc(INI_STRING_LEN)
nLen := GetPrivateProfileString(String2Psz(cSection), NULL_PSZ, String2Psz(" "), PSZ(_CAST, ptrBuffer), INI_STRING_LEN, String2Psz(SELF:FullPath))
cBuffer := Psz2String(PSZ(_CAST, ptrBuffer))
MemFree(ptrBuffer)
RETURN IIF(nLen<=0, {}, String2Array(Left(cBuffer, nLen-1), _CHR(0)))
LG Franz