Making QuickBasic 1.1 use less memory

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
mikefromca
Coder
Posts: 41
Joined: Wed Oct 16, 2019 11:28 am

Making QuickBasic 1.1 use less memory

Post by mikefromca »

Turns out that when I move my whole DOS setup from a DOSBOX environment to a real DOS machine, I run out of memory pretty quick, especially when it comes to the original QuickBasic.

So anyways, I fire up QuickBasic 1.1 for MS-DOS 6.22 and I simply execute the SHELL instruction. then in the DOS shell, I execute this command:

Code: Select all

mem /d/p
then I find entries for QuickBasic (as QBASIC), so I execute:

Code: Select all

mem /m
And I got blown by the amount of memory that QuickBasic 1.1 used just to allow me to start a DOS shell. On my system, the amount of conventional memory reported to be used by QuickBasic was 286,672 (280K). That's almost half the entire conventional memory for a DOS system.

Is there a way I can execute QuickBasic where it uses much less memory while being able to execute commands?
angros47
Veteran
Posts: 79
Joined: Mon Sep 08, 2008 12:52 pm
Contact:

Re: Making QuickBasic 1.1 use less memory

Post by angros47 »

Yes, there is: don't use SHELL.

If you want to execute other DOS programs, after your QB program, you should use a .BAT file that calls your program, and after that calls the other one. If you want your QB program to send a message to the .BAT file, you can use something like:

DECLARE SUB ExitWithErrLvl ALIAS "_exit" (BYVAL errorlevel%)

(you need to have loaded QB.QLB)

Then you leave your program with something like:

ExitWithErrLvl 1

and in the .BAT file you put something like
IF ERRORLEVEL 1
Post Reply