Hi.
I use the function below to read keys from ini files, and it works fine.
Sometimes I want to read an entire section into a string variable. How could
that be accomplished?
*****************************************************************
*!* Function IniRead
*****************************************************************
Lparameters cSection, cKey, nLen, cInifile
Local cRetval, cPath
cRetval = Space(nLen) + Chr(0)
Declare Integer GetPrivateProfileString In Win32API As GetPrivStr ;
STRING cSection, String cKey, String cDefault, String @cBuffer, ;
INTEGER nBufferSize, String cIniFile
If GetPrivStr(cSection, cKey, "", @cRetval, Len(cRetval),cInifile) == 0
Messagebox('Ini file error', 16, program())
Endif
Do While Not Empty(At(Chr(0),cRetval))
cRetval = Alltrim(cRetval)
cRetval = Left(cRetval,Len(cRetval)-1)
Enddo
Return(cRetval)
*****************************************************************
*!* End of function IniRead
*****************************************************************