# $EPIC: winnum,v 1.4 2001/07/16 18:57:15 jnelson Exp $
Synopsis:
   $winnum()
   $winnum(<window-name>)
   $winnum(<window-refnum>)

Technical:
   * This function returns the window refnum of a window;
     * If a window name is provided, then the refnum of that window;
     * If a window refnum is provided, then the refnum of that window;
     * If no argument is provided, then the refnum of the current window.
   * If the specified window is invalid (either the name is not in use,
     or the refnum is not in use), the return value is -1.

Practical:
   There are three useful purposes to this function: to find out what the 
   current window is, to find the refnum for a named window, and to figure
   out if a window refnum is still valid.

Returns:
   The window refnum for the specified window, or the current window if no
   argument is given.  -1 is returned for error.

Examples:
   $winnum()               returns number of current window
   $winnum(ircII)          would return 1 if window 1's name is "ircII"
   $winnum(5)              would return 5 if window 5 exists, or would
                           return -1 if there is no window refnum 5.

History:
   This function first appeared in ircII-2.2pre1, and did not take an 
   argument.  Support for arguments first appeared in EPIC4pre1.041.

See Also:
   winnam(6)

