mIRC Homepage
I'm not sure whether to post this in the "Bug Reports" or "Feature Suggestions" section,
please excuse me if it doesn't belong here.

I'm wondering if $chan(#chan) can be changed to return the number of the given channel instead of just "#chan".

$nick(#chan,asdfasdf) returns "3" if asdfasdf is the third nick,
but $chan(#chan) just returns "#chan" instead of #chan's number, say "5".

And in $chan()'s help I can't find a property or way to find out the given channel's number either.

Thanks!
Probably not anymore, since it would break a lot of scripts that rely on this behaviour.

Also this behaviour exists so that you can do things like "//msg $$chan($1) hello" and have it fail gracefully/halt if $1 is not a channel you are on (because $chan(#chan) can return $null).
Hmm, true, good points.

So I take it the only way to get a channel's number is by looping through $chan(%i) and checking for the given channel yourself?
A $chan() property for this might be neat.

Also, posting this in the "Bug Reports" rather than in the "Scripts & Popups" section probably was a bad idea after all.
Yea, that's how you would do it. Perhaps Khaled could add a $chan(#).pos that returns the N value.
Alright, thank you.
but what order would it use? because there is the 'alphabetic order' aswell as the 'joined order'.

should it be consistant over the two by choosing just one? and which one would that be? the currently active sorting method or always alphabetic?
It would use the same order as you use and see in your switch-/treebar, depending on your alt + o -> Display -> Sort buttons setting.
It would return whatever the N that represents the channel in $chan(N) is. That doesn't include switchbar order AFAIK.
© mIRC Discussion Forums