Skip to content

Commit

Permalink
optimized iniread fallback function
Browse files Browse the repository at this point in the history
  • Loading branch information
Eruyome committed Oct 5, 2016
1 parent 9e30fa2 commit 19b8fd1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions trade_data/TradeMacroInit.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,13 @@ ReadIniValue(iniFilePath, Section = "Misc", IniKey="", DefaultValue = "")
FileReadLine, line, %iniFilePath%, %A_Index%
If ErrorLevel
break
If InStr(line, IniKey, false) {

l := StrLen(IniKey)
NewStr := SubStr(Trim(line), 1 , l)
If (NewStr = IniKey) {
RegExMatch(line, "= *(.*)", value)
If (StrLen(value1) = 0) {
OutputVar := DefaultValue

OutputVar := DefaultValue
}
Else {
OutputVar := value1
Expand Down

0 comments on commit 19b8fd1

Please sign in to comment.