PROTECT

_Alignment, _Indent, _LMargin, _RMargin, _Tabs

These variables are vestiges of the printer control system introduced in FoxPro 1.0. Like so much in FoxPro, it seemed like a good idea at the time, but has been superseded several times since.

These variables control aspects of individual lines produced by ? and ??. Except for _TABS, they're only effective when _WRAP is .T.

Usage

_ALIGNMENT = "LEFT" | "CENTER" | "RIGHT"
No, this variable doesn't determine the political affiliation of the end user. It indicates how text output with ? or ?? should be lined up. Best of all, it works as advertised.

Usage

_INDENT = nCharsToIndent

This one, on the other hand, is flaky. It works, sort of, when applied to memo fields, but not the rest of the time. We say "sort of" because it moves all lines of the memo out to the specified indent, not just the first line. Consider it a "block indent" rather than a "first line indent" and it makes some sense. This, no doubt, ties in with FoxPro's "automatic indent" capability which is so handy when writing code, but it keeps happening even when automatic indent is turned off.


Usage

_LMARGIN = nLeftMargin _RMARGIN = nRightMargin
These variables let you set left and right margins for the print area. Both are measured from the left edge, in character columns of the current output font.

Usage

_TABS = cListOfTabStops
cListOfTabStops is a comma-delimited list of columns. Any CHR(9) in the text being output moves you to the next tab stop.

All in all, this is a nice set of pretty functional variables. It is remarkable that they work correctly with both proportional and non-proportional fonts. The only problem is they work with ? and ??. We don't use those much anymore, except to sound the bell, where margins and the like aren't particularly relevant.

Example

_LMARGIN = 5 _RMARGIN = 75 _WRAP = .T. _TABS = "15,25,35" ? "Look"+CHR(9)+"I can"+CHR(9)+"Make"+CHR(9)+"Columns" ? "This is the beginning of a long line that will eventually "+;  "wrap, showing how the margins work. In fact, showing THAT "+;  "the margins work."

See Also

?, ??, _Wrap


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