mIRC Home    About    Download    Register    News    Help

Print Thread
#28206 05/06/03 02:27 AM
Joined: Jun 2003
Posts: 20
I
Ameglian cow
OP Offline
Ameglian cow
I
Joined: Jun 2003
Posts: 20
hopefully, there will be a feature included to if-than-else called 'or'. it would be usefull because i dont want a million if statements in my code.


Get into the Flamez
#28207 05/06/03 02:57 AM
Joined: May 2003
Posts: 177
P
Vogon poet
Offline
Vogon poet
P
Joined: May 2003
Posts: 177
What's wrong with the || operator? I see no use in duplicating something that can already be done very easily.

#28208 05/06/03 02:59 AM
Joined: Jun 2003
Posts: 20
I
Ameglian cow
OP Offline
Ameglian cow
I
Joined: Jun 2003
Posts: 20
never heard of it.


Get into the Flamez
#28209 05/06/03 03:01 AM
Joined: May 2003
Posts: 177
P
Vogon poet
Offline
Vogon poet
P
Joined: May 2003
Posts: 177
Here's an example:

alias test {
;Usage /test [1 or 2]
if (($1 == 1) ||[/b] ($1 == 2)) { echo -a Debug }
else { echo -a Error }
}


From the mIRC Help file:

Combining comparisons

You can combine comparisons by using the && for AND and || for OR characters.



#28210 05/06/03 03:05 AM
Joined: Jun 2003
Posts: 20
I
Ameglian cow
OP Offline
Ameglian cow
I
Joined: Jun 2003
Posts: 20
ya, but you cant have 2.
i mean like
if (blah isin $1-) { blah } | or(blahh isin $1-) { blahh } }


Get into the Flamez
#28211 05/06/03 03:09 AM
Joined: Jun 2003
Posts: 20
I
Ameglian cow
OP Offline
Ameglian cow
I
Joined: Jun 2003
Posts: 20
i mean like, it cant be seperated to 2 commands. like for if you want a diff return value, if i dont make sence, im half asleetp


Get into the Flamez
#28212 05/06/03 03:09 AM
Joined: May 2003
Posts: 177
P
Vogon poet
Offline
Vogon poet
P
Joined: May 2003
Posts: 177
That's what elseif is for.

alias test {
if (blah isin $1-) { blah }
elseif (blahh isin $1-) { blahh }
}

#28213 05/06/03 02:11 PM
Joined: May 2003
Posts: 22
A
Ameglian cow
Offline
Ameglian cow
A
Joined: May 2003
Posts: 22
ohh boy....

try reading the helpfile before posting wierd suggestions


--------------------------------------------------
I really don't know anything.... I just fake it
#28214 06/06/03 02:12 AM
Joined: Jun 2003
Posts: 20
I
Ameglian cow
OP Offline
Ameglian cow
I
Joined: Jun 2003
Posts: 20
my help file didnt have || in the if section if.. and besides, i was half asleep.


Get into the Flamez
#28215 06/06/03 04:02 AM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Well then I must ask, what help file are you looking in exactly???

/help /if returns (among other things):

Combining comparisons
You can combine comparisons by using the && for AND and || for OR characters.

number {
if (($1 > 0) && ($1 < 10)) {
if ($1 < 5) echo Number is less than five
else echo Number is greater than five
}
else echo Number is out of bounds
}

This alias checks if the number you specify, when you type /number <value>, lies within the required range.


Link Copied to Clipboard