CREATE QUERY

SCols(), SRows()

These two functions tell you about the size of the main Visual FoxPro window with respect to the current font. You can find similar (sometimes the same) information using the system variable _SCREEN and its properties Height and Width.

Usage

nScreenCols = SCOLS() nScreenRows = SROWS()
The functions return the number of columns and rows available in the main window using the current font. If you change the screen font, the results change. Of course, resizing the window (whether in code or interactively) changes the results. The values returned are in foxels, FoxPro's special unit of measure that corresponds roughly to a character. These functions are primarily included for backward compatibility with DOS applications that used to have to check for 43-line EGA screens and 50-line VGA screens.

The system variable _SCREEN is an object reference to the main window. You can both inquire about and change that window's characteristics by referencing the variable. The Height and Width properties tell you about the size of the window. By default, those properties use pixels, which are not sensitive to font changes. However, by changing _SCREEN.ScaleMode to 0, you can see the results in foxels. In that case, Height and Width are the same as SROWS() and SCOLS(), respectively.

Example

nRows=SROWS() nCols=SCOLS()   ? SROWS(),SCOLS() _SCREEN.FontName="Courier New" ? SROWS(),SCOLS() _SCREEN.FontSize=14 ? SROWS(),SCOLS()

See Also

FontBold, FontItalic, FontMetric(), FontName, FontSize, Height, Modify Window, ScaleMode, _Screen, SysMetric(), WFont(), Width


View Updates

Copyright © 2002 by Tamar E. Granor, Ted Roche, Doug Hennig, and Della Martin. All Rights Reserved.



Hacker's Guide to Visual FoxPro 7. 0
Hackers Guide to Visual FoxPro 7.0
ISBN: 1930919220
EAN: 2147483647
Year: 2001
Pages: 899

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net