dbarrett
28th July 2006 03:28 UTC
Forcing reload/reread for ReadINIStr?
So far as I can tell, ReadINIStr loads the INI file into memory once, rather than re-reading the file each time its called. This is a sensible optimization.
However, is there any way to force the INI to be re-read, such as after the file is modified?
Comperio
28th July 2006 03:44 UTC
try FlushINI
Mark Nascimento
28th July 2006 04:45 UTC
I tried FlushIni but didn't work.
I did this: The new data is recorded in a new ini or txt file, temporarily created or modified during the initials functions. Then, below in sections, I re-read the results from this temp text. But wait ! there is more and... FREE !
When you run the app again, in the start, before calling this ini file, Read the data from the temp file and write them in your defaut ini file. Nobody will knows, but works.
I've been using this method and never failed yet.
dbarrett
29th July 2006 21:36 UTC
Mark -- Great idea. Now I copy the INI to a temp file, read it, and then delete the temp file. Works great.
GetTempFileName $R0
CopyFiles "my.ini" $R0
ReadINIStr $0 $R0 "My Section" "MyName"
Delete $R0
Thanks for the tip!