* WriteINI - Writes an item to an INI file, pretty straight forward *

PROCEDURE WriteINI &&(cINIFile AS String, cTopic AS String, cItem AS String, cValue AS STRING)
	LPARAMETERS cINIFile, cTopic, cItem, cValue
	DECLARE INTEGER WritePrivateProfileString IN Win32API ;
		STRING cTopic, ;
		STRING cItem, ;
		STRING cValue, ;
		STRING cINIFile
	WritePrivateProfileString(m.cTopic, m.cItem, m.cValue, m.cINIFile)
ENDPROC

* ReadINI - Reads values from an INI file, pretty straight forward *

FUNCTION ReadINI &&(cINIFile As String, cTopic AS String, cItem AS String)	AS STRING
	LPARAMETERS cINIFile, cTopic, cItem
	DECLARE INTEGER GetPrivateProfileString IN Win32API ;
		STRING cTopic, ;
		STRING cItem, ;
		STRING cDefault, ;
		STRING cValueBuf, ;
		INTEGER nValueBufSize, ;
		STRING cINIFile

	PRIVATE cValue, nBuf
	m.cValue = REPLICATE(CHR(0), 255)
	m.nBuf = GetPrivateProfileString(m.cTopic, m.cItem, '', @cValue, 255,	m.cINIFile)
	RETURN LEFT(m.cValue, m.nBuf)
ENDFUNC
