When the above was posted, the decision was made not to use
IniDelete. Can't remember why- perhaps the help didn't provide enough examples- or there were other issues regarding extra spaces in the value field- but recall in using it the ini files got messed up.
So with just IniWrite and IniRead it's convenient to initialize all or most entries in the file with something like:
Code: Select all
IniWrite, %A_Space%, %MyIniName%, Section, Key
Values can then be written to the key, but they will always have a trailing space.
In the
IniRead docs there's
Default
The value to store in OutputVar if the requested key is not found. If omitted, it defaults to the word ERROR. To store a blank value (empty string), specify %A_Space%.
When the value wants to be deleted again, we must do this again:
Code: Select all
IniWrite, %A_Space%, %MyIniName%, Section, Key
The value is replaced by the space, but
not the trailing space(s) already there.
In hindsight, instead of writing a space to delete, it may just be easier to delete the entire key with IniDelete, (if it works), and rewrite it.
Perhaps there are benefits you see with IniDelete?