Microsoft KB Archive/36576

= CTRL+Z Embedded in Source Truncates BC.EXE Compilation =

Article ID: 36576

Article Last Modified on 8/16/2005

-

APPLIES TO


 * Microsoft Visual Basic for MS-DOS
 * Microsoft QuickBasic 4.0
 * Microsoft QuickBASIC 4.0b
 * Microsoft QuickBasic 4.5 for MS-DOS
 * Microsoft BASIC Professional Development System 7.0
 * Microsoft BASIC Professional Development System 7.1
 * Microsoft BASIC Compiler 6.0
 * Microsoft BASIC Compiler 6.0b

-



This article was previously published under Q36576



SUMMARY
The QB.EXE editor allows you to embed control characters into a source file by pressing CTRL+P followed by CTRL+. This information is documented in a table on Page 135 of the &quot;Microsoft QuickBasic 4.0: Learning and Using&quot; manual for versions 4.0 and 4.0b, and on Page 204 of the &quot;Microsoft QuickBasic 4.5: Learning to Use&quot; manual for version 4.5.

When using this technique, do not type CTRL+Z into the source file if the file is saved as text. For a file saved as text, CTRL+Z marks the end of the file (EOF) for BC.EXE and other Microsoft compilers. (This feature is a carryover from the end-of-file standard required for text files in MS-DOS versions 1.x.) You must save in fast load format for BC.EXE to accept embedded CTRL+Z characters.

A CTRL+Z byte appears on the screen as a right-arrow symbol. To print a right-arrow symbol on the screen, use the statement PRINT CHR$(26) instead of embedding a CTRL+Z in a string constant.



MORE INFORMATION
BC.EXE stops compiling text source files when it reaches a CTRL+Z (ASCII value 26) byte. The program below demonstrates this behavior and terminates BC.EXE with a &quot;Label Not Defined&quot; error message. GOSUB lab PRINT &quot;Here is a right-arrow character:&quot; PRINT &quot;[Press CTRL+P followed by CTRL+Z here in the QB.EXE 4.00 editor.]&quot; END lab: PRINT &quot;Test&quot; RETURN The following equivalent program compiles successfully in BC.EXE: GOSUB lab PRINT &quot;Here is a right-arrow character:&quot; PRINT CHR$(26) END lab: PRINT &quot;Test&quot; RETURN

Additional query words: VBmsdos QuickBas BasicCom 1.00 4.00 4.00b 4.50 6.00 6.00b 7.00 7.10

Keywords: KB36576

-

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

© Microsoft Corporation. All rights reserved.