mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2003
Posts: 12
A
ash Offline OP
Pikka bird
OP Offline
Pikka bird
A
Joined: Feb 2003
Posts: 12
This is not a 'bug' as such, but just illogical behaviour by mirc. $addtok and $deltok (and perhaps other token identifers that I haven't tested) return nothing when a null token is used.

For example,
$addtok(a b c d,$network,32) = a b c d AustNet
$addtok(a b c d,$lakjaefh,32) = returns nothing

This should return "a b c d" since it's generally what would be expected.

Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
I agree, $addtok should return the input string unaffected in case of null tokens, just like $+(a,$null,b) returns "ab" and not $null or like $replace works fine with null parameters.

And now we're talking about it, I'd really like token identifiers to work with a positive AND a negative number as a range. For example, I'd like $gettok(1 2 3 4 5 6 7 8 9,2--3,32) to return "2 3 4 5 6 7" and not "2".


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
That would be nice. I'd like to be able to use $puttok(1:::::5,blarg,3,58) and have it return 1::blarg:::5 instead of 1:5.


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
Joined: Jan 2003
Posts: 2,523
Q
Hoopy frood
Offline
Hoopy frood
Q
Joined: Jan 2003
Posts: 2,523
I haven't decided whether I'd like $*tok identifiers to take into consideration null tokens in the input string. That's because I've needed both functions; there are cases where I want to 'fix' a string quickly, fex I want to convert ":a::a:" to "a:a" (this is an example that comes to mind, there have been other, more reasonable cases I've needed it). In such cases, I use $gettok(<string>,1-,58). If null tokens were considered, I wouldn't be able to do that. There are cases, though, that I'd sacrifice that for the ability to handle null tokens (although the introduction of regex in 5.9 helped on this).


/.timerQ 1 0 echo /.timerQ 1 0 $timer(Q).com

Link Copied to Clipboard