mIRC Home    About    Download    Register    News    Help

Print Thread
#174581 09/04/07 10:27 PM
Joined: Sep 2005
Posts: 2,881
H
hixxy Offline OP
Hoopy frood
OP Offline
Hoopy frood
H
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,411
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,411
Thanks this has been fixed for the next version.

Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
Similar thing :
if (<something> !% <something>) return * /if: '' unknown operator



#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
//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
R
Hoopy frood
Offline
Hoopy frood
R
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
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.)

Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
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
R
Hoopy frood
Offline
Hoopy frood
R
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
H
hixxy Offline OP
Hoopy frood
OP Offline
Hoopy frood
H
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.


Link Copied to Clipboard