Here two function that I used for this:
FUNCTION ReadIniString(cSection, cEntry, cIniFile)
LOCAL ret_val
DECLARE INTEGER GetPrivateProfileString IN Win32API AS GetPrivStr ;
String cSection, String cKey, String cDefault, String @cBuffer, ;
Integer nBufferSize, String cINIFile
m.ret_val = SPACE(1024)
GetPrivStr(m.cSection, m.cEntry,"",@ret_val,1024,m.cIniFile)
CLEAR DLLS GetPrivateProfileString
RETURN STRTRAN(ALLTRIM(ret_val), CHR(0), "")
FUNCTION WriteIniString(cSection, cEntry, cString, cIniFile)
DECLARE INTEGER WritePrivateProfileString IN Win32API AS WritePrivStr ;
String cSection, String cKey, String cValue, String cINIFile
WritePrivStr(m.cSection,m.cEntry,m.cString,m.cIniFile)
CLEAR DLLS WritePrivateProfileString
RETURN ""
*** Usage:
WriteIniString([Main],[TestEntry],[AbraKadabra],[MyIniFile.Ini])
? ReadIniString([Main], [TestEntry], [MyIniFile.Ini])
[/code]
Borislav Borissov