mIRC Home    About    Download    Register    News    Help

Print Thread
/if operator issues #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.

Re: /if operator issues [Re: hixxy] #174657 10/04/07 04:29 PM
Joined: Dec 2002
Posts: 4,736
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 4,736
Thanks this has been fixed for the next version.

Re: /if operator issues [Re: Khaled] #174957 15/04/07 02:58 AM
Joined: Jul 2006
Posts: 3,702
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,702
Similar thing :
if (<something> !% <something>) return * /if: '' unknown operator



Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: /if operator issues [Re: hixxy] #175019 16/04/07 01:22 AM
Joined: Jul 2006
Posts: 3,702
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,702
//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.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: /if operator issues [Re: Wims] #175021 16/04/07 01:54 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
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.)

Re: /if operator issues [Re: RusselB] #175026 16/04/07 03:21 AM
Joined: Jul 2006
Posts: 3,702
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,702
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.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: /if operator issues [Re: Wims] #175027 16/04/07 03:28 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
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.

Re: /if operator issues [Re: RusselB] #175031 16/04/07 10:33 AM
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.