$window.list

Generates lists of windows
Syntax

$window.list(<type>[,<irc_context_id>])

Description
Returns an array of window identifiers with a speficied type and eventually belonging to a specified irc context.
<type> is a window type such as 'query' or 'channel'.
See window.listtypes for a list of available window types in this KVIrc release.
If <type> is the special word 'all', all the window types are listed.
<irc_context_id> specifies the irc context in which the windows are searched.
If no <irc_context_id> is specified , the current one is used.
If <irc_context_id> is the special word 'all' , all the irc context are searched.
The windows that do not belong to any irc context (such as DCC windows), must be searched by using 'all' as <irc_context_id>.
Examples
    # List all the queries of the current irc context
    echo $window.list(query)
    # Equivalent to the above
    echo $window.list(query,$ic)
    # List all the channels in all the irc contexts
    echo $window.list(channel,all)
    # List all the windows in the current irc context
    echo $window.list(all)
    # List all the windows in all irc contexts
    echo $window.list(all,all)
    # List all the DCC Send windows
    echo $window.list(dccsend,all)
    # Ok , let's use it
    # A nice alias that allows iterating commands through all the consoles
    # Note the array returned by $window.list
    # This is by LatinSuD :)
    alias(iterate)
    {
        %ctxt[]=$window.list(console,all)
        for(%i=0;%i<%ctxt[]#;%i++)
        {
            eval -r=%ctxt[%i] $0-
        }
    }
    iterate echo Hi ppl! :)
    # The returned array works nicely also in foreach
    # Say hi to all the channels :)
    alias(sayallchans)
    {
        foreach(%x,$window.list(channel,all))
                say -r=%x $0-;
    }
    sayallchans Hi ppl :)
See also
window.listtypes

Main, Functions
KVIrc 3.0.0 Documentation
Generated by root at Sat Jan 22 17:38:25 2005