Conditionally Loading QBHERC Hercules Support from QuickBasic
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.
- 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.
Hercules support was introduced in QuickBasic Version 4.00. For moreinformation, please see the README.DOC file for QuickBasic Versions4.00 and 4.00b.
Article ID: 37307 - Last Review: 02/28/2014 00:19:53 - Revision: 1.2
- kbnosurvey kbarchive KB37307