Page 1 of 1

Making QuickBasic 1.1 use less memory

Posted: Sat Jan 30, 2021 9:21 pm
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?

Re: Making QuickBasic 1.1 use less memory

Posted: Sun Feb 07, 2021 3:44 pm
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