mIRC Homepage
Posted By: DaveC ISNUM and negitive values - 30/10/05 04:24 PM
Just found out you cant check a number against a negitive start value, looks like the pharser sees -N as being N or less, it can be worked around easy enough, just thought id mention it.

example

//if (-4 isnum -3-9) echo BLAH
Posted By: Mpdreamz Re: ISNUM and negitive values - 30/10/05 05:03 PM
strange indeed
//if (3 isnum -) echo BLAH
//if (-1 isnum -asd) echo BLAH1

smirk
Posted By: RusselB Re: ISNUM and negitive values - 31/10/05 03:28 AM
I did your test example, and it worked for me, however, when I tried //if (-4 isnum 3--9) echo blah it returned nothing

I thought it would return blah, since -4 is in the range 3 to -9, but it doesn't.

Looks to me, like the range has to be specified with the lowest number first //if (-4 isnum -9-3) echo blah, does return blah
Posted By: Rand Re: ISNUM and negitive values - 31/10/05 05:06 AM
I think his point was that it *does* echo, and it shouldn't.

//if (-10 isnum -8-5) { echo -s $v1 }

Should see if $v1 matches -8 through positive 5. But it still is a "$true" statement, when it should be a $false.
Posted By: RusselB Re: ISNUM and negitive values - 31/10/05 07:55 AM
OK, I have to agree, but using the original example, it comes back true & it is true.
Posted By: Riamus2 Re: ISNUM and negitive values - 31/10/05 04:49 PM
-3-9 in the original example was -3 to +9, so it came back true when it should have been false. smile

It does seem that negatives aren't treated correctly with isnum. It may have to do with the fact that - isn't really negative and in this case, it is treated as a range character, so messes it up the same way a comma can mess things up.

I can't seem to find a way to make it work properly.
Posted By: DaveC Re: ISNUM and negitive values - 31/10/05 11:40 PM
hey dude, i suggest you actually try using the original example <snicker snicker>
Posted By: RusselB Re: ISNUM and negitive values - 01/11/05 01:09 AM
This is totally weird, because I did test the original example before I posted, and it worked correctly, yet just now when I tried it again, it didn't. *sigh*
© mIRC Discussion Forums