Using Dual Video Display Cards and Monitors with QuickBasic (35241)



The information in this article applies to:

  • Microsoft QuickBASIC 4.0
  • Microsoft QuickBASIC 4.0b
  • Microsoft QuickBASIC 4.5
  • Microsoft BASIC Compiler for MS-DOS and OS/2 6.0
  • Microsoft BASIC Compiler for MS-DOS and OS/2 6.0b
  • Microsoft Basic Professional Development System for MS-DOS 7.0

This article was previously published under Q35241

SUMMARY

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.

MORE INFORMATION

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:
OPEN "cons:" FOR OUTPUT AS #1
DEF SEG = 0
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."
				

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