|
Joined: Sep 2005
Posts: 2,881
Hoopy frood
|
OP
Hoopy frood
Joined: Sep 2005
Posts: 2,881 |
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.
|
|
|
|
Joined: Dec 2002
Posts: 5,524
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 5,524 |
Thanks this has been fixed for the next version.
|
|
|
|
Joined: Jul 2006
Posts: 4,222
Hoopy frood
|
Hoopy frood
Joined: Jul 2006
Posts: 4,222 |
Similar thing : if (<something> !% <something>) return * /if: '' unknown operator
#mircscripting @ irc.swiftirc.net == the best mIRC help channel
|
|
|
|
Joined: Jul 2006
Posts: 4,222
Hoopy frood
|
Hoopy frood
Joined: Jul 2006
Posts: 4,222 |
//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.
#mircscripting @ irc.swiftirc.net == the best mIRC help channel
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
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 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 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.)
|
|
|
|
Joined: Jul 2006
Posts: 4,222
Hoopy frood
|
Hoopy frood
Joined: Jul 2006
Posts: 4,222 |
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.
#mircscripting @ irc.swiftirc.net == the best mIRC help channel
|
|
|
|
Joined: Aug 2004
Posts: 7,252
Hoopy frood
|
Hoopy frood
Joined: Aug 2004
Posts: 7,252 |
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.
|
|
|
|
Joined: Sep 2005
Posts: 2,881
Hoopy frood
|
OP
Hoopy frood
Joined: Sep 2005
Posts: 2,881 |
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.
|
|
|
|
|