DADiSP Worksheet Functions > Function Categories > Query Functions > GETWNUM

 

GETWNUM

Purpose:

Returns the Window number of a Window.

Syntax:

GETWNUM(win)

win

-

Optional. Window reference. Defaults to the current Window.

Returns:

An integer, the Window number of the Window.

Example:

getwnum(w3)

 

returns 3.

Example:

If Window 2 is the current Window:

 

getwnum - 1

 

returns 1.

Example:

eval(sprintf("deriv(W%d)", getwnum-1))

 

performs a derivative of Window 1.

Example:

wref = refwindow(w3);

n = getwnum(wref);

 

n == 3

Remarks:

GETWNUM is useful in SPL routines and command files where the current Window number may not be obvious.

 

See GETWINNAME to return a string that contains the symbolic or numeric name of the Window.

See Also:

GETWINNAME

NUMWINDOWS

STRWIN

REFWINDOW

WINNAME

WINSTATUS