It's not a bug. You already know that $chan(N) returns the Nth channel, if N is a number greater than 0. If it's zero or a non-numeric string the first character of which is not in $chantypes, it returns the total number of channels (if N is a string that begins with one of the chars in $chantypes, mirc returns the channel name if you are on that channel, otherwise $null). So, if you are on #foo and #bar and $chantypes for that network returns "#&":
$chan(#foo) returns #foo
$chan(#mirc) returns $null
$chan(&mirc) returns $null
$chan(+mirc) returns 2
$chan(foo) returns 2
Many mirc identifiers do the same thing, fex, $gettok(a b c,a,32), $line(status window,a), a fact that suggests this is intentional.
Edit: and once more, somebody sneaked in an posted while I was previewing my post...
Last edited by qwerty; 23/07/03 05:54 PM.