[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
+---------------------------------+
| WCOLS |
+---------------------------------+
WCOLS([<window name>])
-----------------------------------
Returns number of columns in a window.
Return value - Numeric
-----------------------------------
The WCOLS() function returns the number of columns in a window.
<window name>
If a <window name> isn't included, the number of columns in the active
output window is returned. If a window isn't active, the number of
columns in the screen is returned. You may also return the number of
columns in the screen by including the null string as the <window name>.
Note that the null string may be used to specify the screen in
functions that return window locations or sizes (WLCOL(), WLROW(),
WCOLS(), WROWS(), etc.). The screen, which underlies all System and
user-defined windows, is sometimes called the desktop.
If you include a <window name> in WCOLS(), the number of columns in the
specified window is returned. WCOLS() may be used to return the number
of columns in a FoxPro system window.
If a FoxPro system window (the Command window, the View window, ASCII
Chart, a Browse window ... ) has been opened and is visible or is hidden
(its name appears in the Window menu), you may include its name in
WCOLS(). If a FoxPro system window is closed, an alert "WINDOW has not
been defined." is displayed. The Debug window is an exception. Once
the Debug window has been opened, its name may included in WCOLS() if it
is visible, hidden or closed.
+---------------------------------+
| Program Example |
+---------------------------------+
To center short output message in last row of window of unknown size:
DO SendMesg WITH 'Message', WCOLS(), WROWS() - 1
*** SendMesg ***
PROCEDURE SendMesg
PARAMETERS msg_string, w_cols, row
STORE (w_cols - LEN(msg_string))/2 TO col
@ row, col SAY msg_string
RETURN
-----------------------------------
See Also: COL(), ROW(), SCOLS(), SROWS(), WROWS(), WLCOL(), WLROW()
-----------------------------------
See Also:
COL()
ROW()
SCOLS()
SROWS()
WROWS()
WLCOL()
WLROW()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson