Microsoft KB Archive/35241

From BetaArchive Wiki
Knowledge Base

Using Dual Video Display Cards and Monitors with QuickBasic

Article ID: 35241

Article Last Modified on 11/21/2006


  • Microsoft QuickBasic 4.0
  • Microsoft QuickBASIC 4.0b
  • Microsoft QuickBasic 4.5 for MS-DOS
  • Microsoft BASIC Compiler 6.0
  • Microsoft BASIC Compiler 6.0b
  • Microsoft BASIC Professional Development System 7.0

This article was previously published under Q35241


QuickBasic allows limited use of two video-display system cards within the same application if the host computer has both a color video card and monitor, plus a monochrome card and monitor. Only the default display (the one that was active when QuickBasic was invoked) has a cursor and graphics capability.

The method requires OPENing "CONS:" FOR OUTPUT AS #n, POKEing the video-mode specifier of the desired output screen into memory location 449 hex, then using a PRINT #n to display text on the desired output monitor. It is important to use "CONS:", not "SCRN:" in the OPEN statement. "SCRN:" is always associated with the default display.

This information applies to Microsoft QuickBasic versions 4.0, 4.0b, and 4.5; to Microsoft Basic Compiler versions 6.0 and 6.0b for MS-DOS; and to Microsoft Basic PDS version 7.0 for MS-DOS.


There is no practical way to put graphics images on the secondary display in QuickBasic. See pages 54 and 55 of the first edition of "The Peter Norton Programmer's Guide to the IBM PC" (published by Microsoft Press, 1985) or page 58 of the second edition (1988) for a list of settings for the video mode. The following code example, which uses 7 (for a monochrome adapter) and 3 (for 80-column text, 16 colors), works with a computer that has a Hercules-compatible monochrome adapter and an EGA color display:

PRINT #1, "This should be on the DEFAULT Screen."
POKE &H449, 7
PRINT #1, "This should be on the MONO Screen."
POKE &H449, 3
PRINT #1, "This should be on the COLOR Screen."

Additional query words: QuickBas BasicCom 6.00 6.00b 7.00

Keywords: KB35241