mIRC Home    About    Download    Register    News    Help

Print Thread
#109490 30/01/05 07:02 AM
Joined: Dec 2002
Posts: 208
H
Hrung Offline OP
Fjord artisan
OP Offline
Fjord artisan
H
Joined: Dec 2002
Posts: 208
I was trying to write an alias that is equivalent to $numtok, but for &binvars; however, I got an infinite loop due to what I consider to be a bug: if you $bfind for a char that happens to appear at the end of a &bvar, with the starting point beyond the end of that bvar, it returns the position of that last char.. Hard to explain in words, so I'll try doing it with code:

Code:
bset &test 1 97
echo -a $bfind(&test,2,97)


Since the &bvar only contains one character, the above should return 0 or $null or something. Instead, it returns 1, or whatever the position of the last 97 happened to be. It doesn't matter what N value is specified, so

Code:
bset -t &test 1 aaa
echo -a $bfind(&test,923,97)


returns 3. Note that if the &bvar ends with anything other than the character you are searching for, 0 is returned, which is as I expect.

Code:
bset -t &test 1 aaab
echo -a $bfind(&test,923,97)

returns 0.

mirc 6.16/winXP+SP2


If I knew now what I will know then... maybe things will have been different...
#109491 30/01/05 07:14 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
It does indeed appear to be an anomoly.

Codable around, but still a bug.


Link Copied to Clipboard