>Michel, I find the discussion enteresting but, could you please give me an example of how to use an INI file?
This is from my framework.
FUNCTION GetIni
* Return the value from an INI file
* expC1 Section
* expC2 Key
* expC3 INI file
PARAMETER tcSection,tcKey,tcFile
PRIVATE lcBuffer,lnLocation
tcFile=IIF(TYPE('tcFile')<>'C',oApp.IniFile,tcFile)
lcBuffer=SPACE(40)+CHR(0)
=GetPrivateProfileString(tcSection,tcKey,'',@lcBuffer,LEN(lcBuffer),tcFile)=0
lnLocation=AT(CHR(0),lcBuffer)
IF lnLocation>0
lcBuffer=SUBSTR(lcBuffer,1,lnLocation-1)
ENDIF
RETURN lcBuffer
FUNCTION WriteIni
* Save an entry in an INI file
* expC1 Section
* expC2 Key
* expC3 Value
* expC4 INI file
PARAMETER tcSection,tcKey,tcValue,tcFile
tcFile=IIF(TYPE('tcFile')<>'C',oApp.IniFile,tcFile)
=WritePrivateProfileString(tcSection,tcKey,tcValue,tcFile)
And, you need to put this on top of your master program.
* DECLARE DLL statements for reading/writing to private INI files
DECLARE INTEGER GetPrivateProfileString IN Win32API;
String cSection,String cKey,String cDefault,String @cBuffer,;
Integer nBufferSize, String cINIFile
DECLARE INTEGER WritePrivateProfileString IN Win32API;
String cSection,String cKey,String cValue,String cINIFile
Little adjustement, like oApp.IniFile, need to be done in order to run it.