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, here's what you need in top of your master program to declare those DLL functions
* 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