CTRL+Z Embedded in Source Truncates BC.EXE Compilation

ID: Q36576


The information in this article applies to:
  • Microsoft Visual Basic Standard and Professional Editions for MS-DOS, version 1.0
  • Microsoft QuickBASIC for MS-DOS, versions 4.0, 4.0b, 4.5
  • Microsoft Basic Professional Development System (PDS) for MS-DOS and MS OS/2, versions 7.0, 7.1
  • Microsoft BASIC Compiler for MS-DOS and MS OS/2, versions 6.0, 6.0b


SUMMARY

The QB.EXE editor allows you to embed control characters into a source file by pressing CTRL+P followed by CTRL+<desired key>. This information is documented in a table on Page 135 of the "Microsoft QuickBasic 4.0: Learning and Using" manual for versions 4.0 and 4.0b, and on Page 204 of the "Microsoft QuickBasic 4.5: Learning to Use" 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 "Label Not Defined" error message.


GOSUB lab
PRINT "Here is a right-arrow character:"
PRINT "[Press CTRL+P followed by CTRL+Z here in the QB.EXE 4.00 editor.]"
END
lab: PRINT "Test"
RETURN 
The following equivalent program compiles successfully in BC.EXE:

GOSUB lab
PRINT "Here is a right-arrow character:"
PRINT CHR$(26)
END
lab: PRINT "Test"
RETURN 

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

Keywords :
Version : MS-DOS:1.0,4.0,4.0b,4.5; :6.0,6.0b,7.0,7.1
Platform : MS-DOS
Issue type :


Last Reviewed: December 9, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.