mIRC Homepage
Posted By: hixxy /if operator issues - 09/04/07 10:27 PM
if (<something> ! <something>) gives an if invalid format error, whereas all other symbols give an invalid operator error.

Also, !>, !>=, !<= and !< are not considered invalid operators. It seems the ! is ignored.
Posted By: Khaled Re: /if operator issues - 10/04/07 04:29 PM
Thanks this has been fixed for the next version.
Posted By: Wims Re: /if operator issues - 15/04/07 02:58 AM
Similar thing :
if (<something> !% <something>) return * /if: '' unknown operator

Posted By: Wims Re: /if operator issues - 16/04/07 01:22 AM
//Var -s %a $iif(1 !%> 1,1,0) > * /if: '$true' unknown operator
">" is just an exemple, this bug with all char ( not tested )

if the var ( %> or else ) exist :
//Var -s %a 1 ,%b $iif(1 !%a 1,1,0) > * /if: '0' unknown operator

This is very strange.
Posted By: RusselB Re: /if operator issues - 16/04/07 01:54 AM
the bug, in this case, is due to the usage of the % character, which, to my knowledge, is only used to start a variable name, or to return the remainder from a division calculation.

If this is so (or even if it's not), just what were you expecting the % sign to do as part of a comparator?

In your second example
Code:
var -s %a 1, %b $iif(1 !%a 1,1,0)

which, substituting the value being assigned to %a (from the first part of the code) into the appropriate location in the second part, gives you
Code:
var %b $iif(1 !1 1,1,0)

Since when is !1 (or not 1) a valid comparator between two different items (it's fine if being used as a full comparison in and of itself.)
Posted By: Wims Re: /if operator issues - 16/04/07 03:21 AM
In my two exemple, even if the variable name exist or not, it should return * /if: 'thing' unknown operator but it return '$true' or '0'.

does the variable is evaluated in the second exemple ? i think it should not be.
Posted By: RusselB Re: /if operator issues - 16/04/07 03:28 AM
It would be evaluated, as only a single evaluation is required, which is the default when referencing a variable.

If you'd used $+(%,a) rather than %a then it would need the double evaluation to return the value the variable was set for, which, it appears, is what you were thinking of.
Posted By: hixxy Re: /if operator issues - 16/04/07 10:33 AM
The bug is due to the fact that mIRC inconsistently reports errors, he's not suggesting the operator is a valid one. mIRC should report !%> unknown operator. There are two operands, and the operator doesn't start with a %, I think in this case it should not be evaluated.
© mIRC Discussion Forums