mIRC Home    About    Download    Register    News    Help

Print Thread
#134289 30/10/05 04:24 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline OP
Hoopy frood
OP Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
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

Joined: Apr 2004
Posts: 759
M
Hoopy frood
Offline
Hoopy frood
M
Joined: Apr 2004
Posts: 759
strange indeed
//if (3 isnum -) echo BLAH
//if (-1 isnum -asd) echo BLAH1

smirk


$maybe
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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

Last edited by RusselB; 31/10/05 03:29 AM.
Joined: Feb 2005
Posts: 342
R
Fjord artisan
Offline
Fjord artisan
R
Joined: Feb 2005
Posts: 342
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.

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
OK, I have to agree, but using the original example, it comes back true & it is true.

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
-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.


Invision Support
#Invision on irc.irchighway.net
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline OP
Hoopy frood
OP Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
hey dude, i suggest you actually try using the original example <snicker snicker>

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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*


Link Copied to Clipboard