read from ini file
-
I have a part of my ini file [temperature] total=5 My code: x=OSGetPrivateProfileString(" temperature","total","5",, sBuff, Len(sBuff), sIni) byteTotal= Val(Left(sBuff, x)) Will the code give me byteTotal =5? What if there no those part( [temperature]) in my ini file? will it finally give me byteTotal =5? Thanks
-
I have a part of my ini file [temperature] total=5 My code: x=OSGetPrivateProfileString(" temperature","total","5",, sBuff, Len(sBuff), sIni) byteTotal= Val(Left(sBuff, x)) Will the code give me byteTotal =5? What if there no those part( [temperature]) in my ini file? will it finally give me byteTotal =5? Thanks
dec82 wrote:
Will the code give me byteTotal =5?
Probably. What happened when you executed the code? No errors?
dec82 wrote:
What if there no those part( [temperature]) in my ini file?
GetPrivateProfileString asks for a default value. It will return this value if the section or the named value doesn't exist :)
I are troll :)