mIRC Home    About    Download    Register    News    Help

Print Thread
#266591 31/12/19 02:19 AM
Joined: Jul 2006
Posts: 4,145
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
The isnum operator works fine on negative number as the first bound, but not on the second, could it be supported?

//if (2 isnum -5-5) echo -aworks
//if (-3 isnum -1--5) echo -a doesn't work, and should


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Wims #266594 31/12/19 08:44 AM
Joined: Apr 2004
Posts: 871
Sat Offline
Hoopy frood
Offline
Hoopy frood
Joined: Apr 2004
Posts: 871
Seems to work fine here, as long as you put the smaller number first?

Code
//if (-3 isnum -5--1) echo -a works


Saturn, QuakeNet staff
Sat #266596 31/12/19 02:59 PM
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
Same thing happens with range of positive numbers not working unless the smaller number is first

//if (5 isnum 3-7) echo -a this shows
//if (5 isnum 7-3) echo -a this does not

Sat #266599 31/12/19 03:54 PM
Joined: Jul 2006
Posts: 4,145
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
I see, It would be nice for isnum to support the other way around, my example should work as it works inside token functions to express relative to the end ranges, which I/scripts have been using for the past 20 years!


#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard