mIRC Home    About    Download    Register    News    Help

Print Thread
#124699 10/07/05 01:04 AM
Joined: Jun 2005
Posts: 44
B
BNX Offline OP
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Jun 2005
Posts: 44
on *:TEXT:!sin*:#: {
if ($2 isalpha) {
/msg $chan Error - 1
}
elseif ($2 isalnum) {
/msg $chan Error - 2
}
else {
/msg $chan $sin($2)
}
}

!sin pie
gives me "Error - 1"

!sin p1e
gives me "Error - 2"


!sin 45
gives me "Error - 2"


$2 is "45" and does not meet the requirments for (letters AND numbers), why does it return true?

I have tried ($2 !isalnum) and it works for "45" but does not catch "p1e"

#124700 10/07/05 01:36 AM
Joined: Jul 2005
Posts: 2
E
Bowl of petunias
Offline
Bowl of petunias
E
Joined: Jul 2005
Posts: 2
Code:
on *:TEXT:!sin*:#: {
if ($2 isalpha) {
/msg $chan Error - 1
}
elseif ($2 isalnum) {
if ($2 isnum) /msg $chan $sin($2)
else /msg $chan Error - 2
}
}

Use this

#124701 10/07/05 04:36 AM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
if you want just alphabetic use isalpha
if you want just numerics use isnum
isalphanum will look for either alphabetic or numeric, requiring one or the other, not both.

#124702 10/07/05 06:59 PM
Joined: Mar 2005
Posts: 420
X
Fjord artisan
Offline
Fjord artisan
X
Joined: Mar 2005
Posts: 420
"isalnum" checks for letters AND numbers. As long as there is a letter or a number or BOTH, it would return true.


If you have a plastic floor runner over your tiles, then you're one Hella Pinoy!
#124703 11/07/05 10:46 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Yeah, I know...bad phrasing on my part...apologiies to anyone else that got confused.


Link Copied to Clipboard