This article was previously published under Q37307
This article has been archived. It is offered "as is" and will no longer be updated.
You will encounter some limitations if you wish to conditionally loadQBHERC.COM or MSHERC.COM from within a QuickBasic program.
The only way to invoke QBHERC.COM or MSHERC.COM from within aQuickBasic program is with the SHELL statement. QBHERC.COM andMSHERC.COM are terminate-and-stay resident (TSR) graphics drivers. TSRprograms will fragment MS-DOS memory when loaded with the SHELLstatement. You can only unfragment the memory by rebooting thecomputer. Fragmentation can drastically reduce the memory available tosubsequent programs run in MS-DOS. This fragmentation problem can beserious, and it is best to avoid SHELLing to QBHERC.COM or MSHERC.COMor any TSR program.
Note that the Basic run-time routines must know at initialization time(that is, when the program is started) whether or not QBHERC.COM orMSHERC.COM has been loaded. This means a program (or batch file) thatloads QBHERC.COM or MSHERC.COM must RUN or CHAIN (or invoke) the .EXEprogram that will use Hercules graphics.
This information applies to Microsoft QuickBasic 4.00, 4.00b, and4.50, to Microsoft Basic Compiler Versions 6.00 and 6.00b, and toMicrosoft Basic PDS Version 7.00 for MS-DOS and MS OS/2.
The following is a possible scenario for conditionally executingQBHERC.COM or MSHERC.COM:
Run a batch file that starts an assembler program that tests if a Hercules card is installed.
Test to see if a Hercules graphics card is installed, and pass this information back to the batch file by using batch ERRORLEVEL (or information written in a text file). (Note that a QuickBasic program does not let you return ERRORLEVELs to batch files, because it always resets the ERRORLEVEL to zero for normal termination.)
If necessary, invoke QBHERC.COM from the batch file.
Invoke the QuickBasic QB.EXE program. The compiler's run-time system now reinitializes to take advantage of QBHERC.COM or MSHERC.COM, which is now resident in memory.
Normally you would run QBHERC.COM or MSHERC.COM manually or from abatch file before invoking a graphics program that takes advantage ofSCREEN 3 on a computer with a Hercules graphics adapter installed.
Hercules support was introduced in QuickBasic Version 4.00. For moreinformation, please see the README.DOC file for QuickBasic Versions4.00 and 4.00b.