mIRC Homepage
Posted By: BNX isalnum problem - 10/07/05 01:04 AM
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"
Posted By: Elfi Re: isalnum problem - 10/07/05 01:36 AM
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
Posted By: RusselB Re: isalnum problem - 10/07/05 04:36 AM
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.
Posted By: xDaeMoN Re: isalnum problem - 10/07/05 06:59 PM
"isalnum" checks for letters AND numbers. As long as there is a letter or a number or BOTH, it would return true.
Posted By: RusselB Re: isalnum problem - 11/07/05 10:46 PM
Yeah, I know...bad phrasing on my part...apologiies to anyone else that got confused.
© mIRC Discussion Forums