The information in this article applies to:
SYMPTOMSIn both FoxPro for Windows and Visual FoxPro for Windows, when attempting to use raw mode printing with @...SAYs that changes the formatting of a word or words on the same line of output, the printed words following the format changes will not print in the expected position. The text after the escape codes will be moved to the left one column for each escape code that is inserted in the @...SAY. CAUSE
When FoxPro executes a series of @...SAYs, it determines the output column
of the first @...SAY, determines the length of the output text, and then
pads the remaining columns with spaces up to the next @...SAY command.
WORKAROUNDThere are two ways to work around this behavior. Use one of the following methods: Method 1With this method, the second @...SAY command must take into account the number of escape codes entered, and the column number must be incremented accordingly. For example, if the name needs to be printed in column 35, the code would appear as follows:
Note that the second @...SAY has incremented the column count by five to
offset the five escape codes.
Method 2This method requires the ability to move the printer head to an exact column position with an escape code. If this is possible, then the two text portions of the @...SAY are concatenated along with the escape code that moves the second text to an exact column number. The following example demonstrates printing the name in column 35 on a Hewlett-Packard LaserJet:
STATUSThis behavior is by design. MORE INFORMATION
Sometimes it is desirable to use raw mode printing in FoxPro for Windows
2.6 or Visual FoxPro for Windows 3.0 to obtain output that may not be
possible using the Report Writer. This works as expected when using escape
codes to change an entire line of output to bold or italic, for example.
The problem occurs when performing in-line formatting changes of a word or
group of words. When attempting to change the word formatting in this
manner, FoxPro will interpret the escape codes as a part of the output
character string and will not print the next word in the correct column
even though it is told in the @...SAY to start printing at an explicit
column number. Therefore, for every escape code entered, the actual column
in which the following word will print will be one less than the actual
column number in the @...SAY.
the code would appear as follows for an HP LaserJet printer:
where 'Pay to the order of:' is bold and the name is non-bold text. The
printer would move the name five columns to the left. This occurs because
the printer requires five escape codes, 'CHR(27)'+'('+'s'+'3' +'0', to turn
off bold formatting. The actual printer output would look like the
following:
Steps to Reproduce Behavior
Additional query words: kbdsd VFoxWin
Keywords : FxprintRaw |
Last Reviewed: December 13, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |