Background COLOR Set in Graphics Mode Affects SHELL Background (75518)



The information in this article applies to:

  • 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 Q75518

SYMPTOMS

If you perform a Basic SCREEN statement to switch to a SCREEN mode other than SCREEN 0, then change the background color using the Basic COLOR statement, and then SHELL to DOS (using either the Basic SHELL statement or the Shell command from the QB.EXE or QBX.EXE File menu), the background color for the DOS shell will incorrectly be the same as that set in Basic instead of the default DOS background color.

To work around this problem, you can use the DOS CLS command within the shell to correctly reset the default DOS background color.

STATUS

Microsoft has confirmed this to be a bug in Microsoft Basic Professional Development System (PDS) versions 7.0 and 7.1 (buglist7.00, buglist7.10) for MS-DOS and Microsoft QuickBasic version 4.5 (buglist4.50) for MS-DOS. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

If you have the ANSI.SYS screen driver loaded (using DEVICE=ANSI.SYS in your DOS CONFIG.SYS file), you may not be able to reset the DOS shell background color using the DOS CLS command within the shell. With ANSI.SYS loaded, you may need to use a DOS MODE command, such as MODE CO80, to reset the default colors for the shell. The MODE command is required for the ANSI.SYS provided with MS-DOS 5.0.

The following is an example that reproduces the problem:
    SCREEN 9      'screen other than 0
    COLOR 4,7     'sets colors to red on white
    PRINT "You are in a Shell"
				
If you run this program with a SHELL statement added at the end (to invoke the DOS command line), or if after running the program you choose the Shell command from the File menu in the QB.EXE or QBX.EXE environment, you will see a white screen with the message "You are in a Shell" in red at the top of the screen. The default background color from the COLOR statement has incorrectly been carried over to the DOS shell, so the background color is white. If your normal default foreground color for your DOS prompt is white, you will not be able to see the DOS prompt or any DOS commands you enter, because they will be white on white. You can type CLS (or MODE CO80 if you have ANSI.SYS loaded) to reset the shell's colors to the normal DOS default.

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