mIRC Home    About    Download    Register    News    Help

Print Thread
#29722 14/06/03 07:52 AM
Joined: Jan 2003
Posts: 52
L
Babel fish
OP Offline
Babel fish
L
Joined: Jan 2003
Posts: 52
It needs it. You have & but no |. Please add | Thanks.

(please save yourself humiliation and dont respond with anything regarding "||" Logical OR comparison)

#29723 14/06/03 10:04 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
what about two bitwise compares? if (bitwise & compare) || (bitwise & compare) { }


-KingTomato
#29724 14/06/03 11:01 AM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
What about it?


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
#29725 14/06/03 11:12 AM
Joined: Jan 2003
Posts: 3,012
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2003
Posts: 3,012
well im not farmiliar with bitwise, but would it work?


-KingTomato
#29726 14/06/03 01:43 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
/help $and
/help $or

#29727 14/06/03 03:04 PM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Why don't you just try? Anyway, it works fine.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
#29728 14/06/03 03:08 PM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Well, there's $and() but also &. In this spirit, there should be a bitwise OR operator too. Maybe the word "need" wasn't such a good choice, but for the sake of completeness, the bitwise OR operator should exist.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
#29729 14/06/03 03:30 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Umm you are forgetting something. mIRC already has a value assigned to |. It's the seperator. You can't just make it a binary or, it already has a function.

#29730 14/06/03 04:40 PM
Joined: Jan 2003
Posts: 52
L
Babel fish
OP Offline
Babel fish
L
Joined: Jan 2003
Posts: 52
If it were inside an if statement it should'nt be a seperator anyway. $or does not work correctly. $or can only compre 2 bits, I should be able to compre bit1 | bit2 | bit3 | bit4, as you can in C.

#29731 14/06/03 05:06 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Umm ok,

if 1 | 2 return $true

mIRC does not require () in an if statement. How is mIRC supposed to know you mean binary or and not command seperation?

Oh also, $or can be chained. In C you'd do 1|2|4, in mIRC $or(1,$or(2,4))

But do keep in mind that mIRC is NOT C. So simply stating "it can be done in C" is not really such a spectacular reason that it must be added.

Last edited by codemastr; 14/06/03 05:42 PM.
#29732 14/06/03 06:27 PM
Joined: Dec 2002
Posts: 117
R
Vogon poet
Offline
Vogon poet
R
Joined: Dec 2002
Posts: 117
You can't use & that way either:
$iif(1 & 3 & 4,$true,$false) returns $true


$input(Me like stars, You too?)
#29733 15/06/03 06:10 AM
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
Even though I think it's quite possible to use "|" for this purpose, I never said the actual char "|" should be used.


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
#29734 15/06/03 06:34 AM
Joined: Jan 2003
Posts: 52
L
Babel fish
OP Offline
Babel fish
L
Joined: Jan 2003
Posts: 52
& is usually used once anyway.
if (bit & (bit | bit | bit))


codemaster:
It is within the if statement, so it would not be evaluated as a separator.
Please do not FIGHT me on my suggestions. Im sick of you fighting me on all my suggestions, [deleted by moderator. disagree without name calling]

Last edited by ParaBrat; 15/06/03 08:57 PM.
#29735 15/06/03 01:22 PM
Joined: Jan 2003
Posts: 64
M
Babel fish
Offline
Babel fish
M
Joined: Jan 2003
Posts: 64
I'm not entirely sure how the script is parsed in reference to the | but I imagine this could be done with a separate $-style calling routine. mIRC would just need to know how to treat it like a bitwise or comparison rather than evaluate whatever as a separator.

Depending on the exact way the lines are parsed, this might not need a huge code overhaul. I guess Khaled would be the only guy who knows.

#29736 15/06/03 04:07 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Thank you for your insults, you really show the merit of your suggestion when you:
a.) Disregard all facts I state and just dismiss them
b.) Resort to insult as the only method to get your message across
c.) Make up facts (e.g. $or can't be "chained")
d.) Assume your interpretation of things is the only correct interpretation.

Furthermore, I notice that only I am "fighting" you, well first off I'm not fighting, if I were fighting you I'd be calling you names and insulting you, whereas in reality you are the only one doing this. And when you say it's just me, well thats just wrong. Rich clearly pointed out that your argument that $or can't be chained (which is untrue) is also irrelevant since & can't be chained either. However when you commented on the fact that & isn't generally chained, you didn't say "Rich you're a loser" however when I point out reasons why it shouldn't be implemented, you do call me a "loser". Furthermore, your response to Rich is invalid. You say:
if (bit & (bit | bit | bit)) well guess what? Thats invalid! mIRC doesn't allow you to use an operator on a subexpression. Try it and see:
//echo -a $iif(1 & 1,$true,$false) [returns $true]
//echo -a $iif(1 & (1),$true,$false) [returns $false]

You can't use a subexpression as an operand to another operator, therefore your rebuttal of Rich's argument is not in support of implementing a |, it is in support of using $or since $or could be used in such a manner, i.e.:
if ($and(bit,$or(bit,$or(bit,bit)))) Thats valid, and as I said:
if (bit & (bit | bit | bit)) is not.

I hope when Khaled looks at the forums, sees your suggestions, he doesn't do the same things you do, that instead he recognizes the fact that this can already be FULLY done using $or, and that | already has a use, therefore leading to ambiguity in the parser and confusion amongst users, and that your examples for possible uses do not even work in the scope of mIRC's scripting language.

#29737 15/06/03 06:56 PM
Joined: Jan 2003
Posts: 52
L
Babel fish
OP Offline
Babel fish
L
Joined: Jan 2003
Posts: 52
It just really pisses me off that you people have to downplay suggestions that would serve a good purpose, MANY features in mIRC serve no real purpose, except to a select few, many are undocumented and were suggested, and one undocumented feature I know of I'm sure the person (whom I know) that suggested it is the ONLY person who actually uses it..

If there is an & operator why shouldn't there be an | evalutation operator in the if statement?

Using $or(bit,$or(bit,$or(bit,$or(bit,bit)))) is very inefficient and messy, yes it can be chained, but if Khaled could look into changing the | functionality in an IF statement, then why not?


#29738 15/06/03 09:04 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Quote:
If there is an & operator why shouldn't there be an | evalutation operator in the if statement?

Well there is also no ~ operator, but no one is complaining that $not is so difficult to use. $or is a perfectly good alternative.

Quote:
Using $or(bit,$or(bit,$or(bit,$or(bit,bit)))) is very inefficient and messy, yes it can be chained, but if Khaled could look into changing the | functionality in an IF statement, then why not?


Ok again, assume | is implemented.
if (bit & (bit | bit | bit)) is STILL invalid syntax.
And since & and | have the same precedence you can't remove the parenthesis without changing the meaning of the expression. Therefore to work around this you would need a hack, the easiest I can think of is using $iif:
if (bit & $iif(bit | bit | bit,$ifmatch,$ifmatch))
Are you going to tell me that syntax is so much cleaner than using $or?

#29739 15/06/03 09:09 PM
Joined: Dec 2002
Posts: 3,127
P
Hoopy frood
Offline
Hoopy frood
P
Joined: Dec 2002
Posts: 3,127
Part of making a suggestion here is that you have to accept that others will give their opinions. They may or may not agree with any given suggestion, but it is certainly their right to voice their opinions giving their reasons for that opinion. Just because someone else doesnt agree with you doesnt mean they are fighting you personally and there is simply no need for namecalling and insults by anyone posting here.

Khaled will add the features he chooses, for his own reasons. Considering the number of ppl using mIRC, it would be impossible to say that any given feature is only used by one person and no one else.


ParaBrat @#mIRCAide DALnet

Link Copied to Clipboard