1# $EPIC: winnum,v 1.4 2001/07/16 18:57:15 jnelson Exp $
2Synopsis:
3   $winnum()
4   $winnum(<window-name>)
5   $winnum(<window-refnum>)
6
7Technical:
8   * This function returns the window refnum of a window;
9     * If a window name is provided, then the refnum of that window;
10     * If a window refnum is provided, then the refnum of that window;
11     * If no argument is provided, then the refnum of the current window.
12   * If the specified window is invalid (either the name is not in use,
13     or the refnum is not in use), the return value is -1.
14
15Practical:
16   There are three useful purposes to this function: to find out what the
17   current window is, to find the refnum for a named window, and to figure
18   out if a window refnum is still valid.
19
20Returns:
21   The window refnum for the specified window, or the current window if no
22   argument is given.  -1 is returned for error.
23
24Examples:
25   $winnum()               returns number of current window
26   $winnum(ircII)          would return 1 if window 1's name is "ircII"
27   $winnum(5)              would return 5 if window 5 exists, or would
28                           return -1 if there is no window refnum 5.
29
30History:
31   This function first appeared in ircII-2.2pre1, and did not take an
32   argument.  Support for arguments first appeared in EPIC4pre1.041.
33
34See Also:
35   winnam(6)
36
37