mIRC Homepage
Posted By: FroggieDaFrog $ini no longer returns 0 - 16/07/15 11:56 PM
$ini(file, section) and $ini(file, section, 0) used to return 0 if the section did not exist, now it returns null.

Possibly related to:
change #30 of v7.39 (?)
Posted By: Khaled Re: $ini no longer returns 0 - 17/07/15 03:37 PM
Thanks for your bug report. I was able to reproduce this issue.

The behaviour for $ini(file, section, 0) was changed a long time ago as described here. It should not have been changed, as it broke scripts. However, someone must have reported it as a bug and, at the time, it looks like I agreed. However, in retrospect, returning 0 was correct.

In fact, there are several situations where $ini() should return 0 but instead returns $null. If all of these are changed to return 0, as they should, it will break all existing scripts that check for $null, as it did for the user in the older bug report.

The last version that returned 0 for $ini(test.ini, section) if section does not exist was mIRC v6.35. I could change $ini() to match mIRC v6.35 behaviour. However, this would break all scripts that have adapted since 2008. It's a tough call.

Update: I have added the following note to the help file $ini() entry: The behaviour of this identifier varies across versions, where either 0 or $null may be returned for a non-existent item.
© mIRC Discussion Forums