Hacker’s Guide to Visual FoxPro
An irreverent look at how Visual FoxPro really works. Tells you the inside scoop on every command, function, property, event and method of Visual FoxPro.
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.
_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.
_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. |
_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.
_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.
_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."