PRINT TAB Blanks Out Passed-Over Characters in Basic (69045)



The information in this article applies to:

  • Microsoft GW-BASIC 3.2
  • Microsoft GW-BASIC 3.22
  • Microsoft GW-BASIC 3.23
  • Microsoft QuickBASIC 4.0
  • Microsoft QuickBASIC 4.0b
  • Microsoft QuickBASIC 4.5
  • Microsoft Basic Professional Development System for MS-DOS 7.0
  • Microsoft Basic Professional Development System for MS-DOS 7.1

This article was previously published under Q69045

SUMMARY

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.

MORE INFORMATION

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
				

Modification Type:MinorLast Reviewed:8/16/2005
Keywords:KB69045