You don't want to use IsObject() a lot? Then don't.
Code: Select all
HU.INI := IniToObj("hy.ini") || {}
locale := HU.INI.HY && HU.INI.HY.locale || "EN"
Run, % (HU.INI.Browser ? HU.INI.Browser.Chrome || HU.INI.Browser.Opera : "") " " (HU.INI.ip && HU.INI.ip.google || "www.google.com")
You could write it exactly as before, but override __Get so that HU.INI.whatever always returns an object. If the INI file doesn't exist, have IniToObj() return an empty INI object.
There's nothing to stop you from changing the error behaviour yourself, if you don't mind sacrificing compatibility with other scripts/code. You can still override the default base object's meta-functions.