mIRC Homepage
Posted By: sparta %var bug - 27/10/11 12:57 PM
if (%var) { do stuff }
this should trigger if the %var exist. And it do so with value 1, but if the value is set to 0 then it will not trigger, since it exist with the value 0 it should trigger.

mirc version
7.19 and 7.22
Posted By: Wims Re: %var bug - 27/10/11 12:59 PM
This isn't a bug, if (condition) is true if 'condition' is different than 0, $false and $null
Posted By: Riamus2 Re: %var bug - 27/10/11 04:02 PM
As Wims explained, an IF looks to see if something is true or not. Not true includes the three things mentioned (0, $null, $false). If you need it to treat a 0 as true, then you need to be more specific in your IF....

For example:
Code:
if (%var != $null) { }


*Note that the above example would also be true for $false, so depending on what %var could be, you may also need to include an OR to check if it's != $false as well.
Posted By: sparta Re: %var bug - 27/10/11 08:01 PM
i noticed that, so made a alias that check the %var. Ty
© mIRC Discussion Forums