Update func.ahk
This commit is contained in:
@@ -27,19 +27,21 @@ ini_load(location)
|
|||||||
Loop
|
Loop
|
||||||
{
|
{
|
||||||
Line := temp.ReadLine()
|
Line := temp.ReadLine()
|
||||||
RegExMatch(Line, "(?<Section>(?<=\[).*(?=\]))|(?<Key>.*)=(?<Value>.*)", &r) ; Key = r.Key, Value = r.Value, Section = r.Section
|
if (Line){
|
||||||
If (r.Section)
|
RegExMatch(Line, "(?<Section>(?<=\[).*(?=\]))|(?<Key>.*)=(?<Value>.*)", &r) ; Key = r.Key, Value = r.Value, Section = r.Section
|
||||||
{
|
If (r.Section)
|
||||||
out[r.Section] := Map()
|
|
||||||
curr_section := r.Section
|
|
||||||
} Else
|
|
||||||
{
|
|
||||||
If (curr_section)
|
|
||||||
{
|
{
|
||||||
out[curr_section].Set(Trim(r.Key, " `t`r`n"), Trim(r.Value, " `t`r`n"))
|
out[r.Section] := Map()
|
||||||
|
curr_section := r.Section
|
||||||
} Else
|
} Else
|
||||||
{
|
{
|
||||||
out.Set(Trim(r.Key, " `t`r`n"), Trim(r.Value, " `t`r`n")) ; this handles things with no section
|
If (curr_section)
|
||||||
|
{
|
||||||
|
out[curr_section].Set(Trim(r.Key, " `t`r`n"), Trim(r.Value, " `t`r`n"))
|
||||||
|
} Else
|
||||||
|
{
|
||||||
|
out.Set(Trim(r.Key, " `t`r`n"), Trim(r.Value, " `t`r`n")) ; this handles things with no section
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} Until (temp.AtEOF)
|
} Until (temp.AtEOF)
|
||||||
|
|||||||
Reference in New Issue
Block a user