Microsoft KB Archive/96299

= PRB: ??? &quot;{&quot; Returns Syntax Error =

Article ID: 96299

Article Last Modified on 12/3/2003

-

APPLIES TO


 * Microsoft FoxPro 2.5b
 * Microsoft FoxPro 2.5a
 * Microsoft FoxPro 2.0
 * Microsoft FoxPro 2.5b for MS-DOS
 * Microsoft FoxPro 2.5a

-



This article was previously published under Q96299



SYMPTOMS
Attempting to print a single brace (&quot;{&quot; or &quot;}&quot;) with the ??? command results in a syntax error because FoxPro expects a matching pair of braces in the command line.



CAUSE
The ??? command sends text directly to the printer. This method is normally used to send &quot;Escape&quot; codes to change printer settings. Using braces is one of three ways to identify ASCII characters. For example, each of the following identify the letter &quot;k&quot; (107 on the ASCII chart):
 * CHR(107)
 * &quot;k&quot;
 * {107}

FoxPro expects braces in pairs when the text is evaluated with the ??? command. If text (either a string or file) is sent to the printer using the ??? command, and the text includes a single brace (&quot;{&quot; or &quot;}&quot;) without a matching brace on the same line, FoxPro detects the first brace as the beginning or end of an ASCII character code sequence.



RESOLUTION
Replace all single left braces (&quot;{&quot;) with &quot;{123}&quot; and single right braces (&quot;}&quot;) with &quot;{125}&quot;. &quot;{123}&quot; will be interpreted as ASCII 123 and the &quot;{&quot; will be printed out and likewise for the right brace.

The following snippet provides an example: SET PRINTER TO xxx.txt ??? &quot;{123}&quot; SET PRINTER TO  MODIFY FILE xxx.txt The text file will contain a single left brace.

Another alternative is to use &quot;{{}&quot; and &quot;{}}&quot; to output a single left and right brace, respectively. The following command, if used in the above code example, will also output a single left brace to the text file: ??? &quot;{{}&quot;



STATUS
This behavior is by design.

Additional query words: FoxDos FoxWin

Keywords: KB96299

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.