KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q69045: PRINT TAB Blanks Out Passed-Over Characters in BASIC

Article: Q69045
Product(s): See article
Version(s): 2.00 2.01 3.00 4.00 4.00b 4.50
Operating System(s): MS-DOS
Keyword(s): ENDUSER | SR# S910117-30 B_BasicCom B_GWBasicI | mspl13_basic
Last Modified: 6-FEB-1991

BASIC's TAB() function will blank out any characters that are being
passed over on the screen. This feature is by design.

This information applies to Microsoft GW-BASIC versions 3.20, 3.22,
and 3.23; to Microsoft QuickBASIC versions 2.00, 2.01, 3.00, 4.00,
4.00b, and 4.50; to Microsoft BASIC Compiler 6.00 and 6.00b; and to
Microsoft BASIC Professional Development System (PDS) versions 7.00
and 7.10 for MS-DOS.

Consider the following code:

      CLS
      PRINT "1234567890"
      PRINT "abcdefghij"
      LOCATE 2,1
      PRINT TAB(4); "DEF"

This program prints the following on the screen:

      1234567890
         DEFghij

The letters "abc", which TAB passed over, have been overwritten with
blanks.

An exception to this behavior is if you trace (F8) in the QB.EXE
editor of QuickBASIC 4.00, 4.00b, or 4.50, or QBX.EXE of BASIC PDS
7.00 or 7.10, where TAB does not erase passed-over text:

      1234567890
      abcDEFghij

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.