Code: Select all
LoadConfig(location)
{
obj := Object()
IfNotExist, %location%
{
MsgBox, 0, , File %location% does not exist
return obj
}
Loop, Read, %location%
{
parts := StrSplit(A_LoopReadLine, "=", A_Space)
key := parts[1]
value := parts[2]
obj[key] := value
}
return obj
}