add function to remove extra empty lines from ini when writing

This commit is contained in:
David Daily 2020-01-14 10:53:05 -06:00
parent 64d7d9dc0a
commit ace6f712cd

View File

@ -90,6 +90,7 @@ ini_writeValue(location, inKey, inValue)
needle := inKey . "=.*" needle := inKey . "=.*"
replacement := inKey . "=" . inValue replacement := inKey . "=" . inValue
tempini := RegExReplace(tempini, needle, replacement,, 1) tempini := RegExReplace(tempini, needle, replacement,, 1)
tempini := RegExReplace(tempini, "\R+\R", "`r`n")
WinWaitNotActive, GloVar.ini WinWaitNotActive, GloVar.ini
FileAppend, %tempini%, tempini ; Append the fixed ini to a new file FileAppend, %tempini%, tempini ; Append the fixed ini to a new file
FileCopy, tempini, %location%, 1 ; Copy the file over, overwriting existing contents FileCopy, tempini, %location%, 1 ; Copy the file over, overwriting existing contents