Q43698: "COMMON in Quick Library Too Small" – Use NAMED COMMON

Article: Q43698
Product(s): See article
Version(s): 4.00 4.00b 4.50
Operating System(s): MS-DOS
Keyword(s): ENDUSER | SR# S890416-1 B_BasicCom | mspl13_basic
Last Modified: 14-DEC-1989

If the COMMON block in a main program module is larger than the COMMON
block of a loaded Quick library subprogram, the error "COMMON in Quick
library too small" occurs. In an executable (EXE) form (LINKed with an
equivalent LIB), the error does not occur.

To work around this behavior, use a named COMMON block for the Quick
library subprograms.

This information applies to QuickBASIC Versions 4.00, 4.00b, and 4.50,
to the QB.EXE environment shipped with Microsoft BASIC Compiler
Versions 6.00 and 6.00b, and to the QBX.EXE environment shipped with
Microsoft BASIC PDS Version 7.00.

Code Example
------------

The following code example causes the "COMMON in Quick library too
small" error when run in the environment; the workaround is described
in comments:

REM Calling program
COMMON a%, b%, c%        'workaround: COMMON /qlbcommon/ a%, b%
REM    So other programs can use also: COMMON a%, b%, c%
CALL test
END

REM Quick Library TEST.QLB
COMMON a%, b%            'workaround: COMMON /qlbcommon/ a%, b%
SUB Test
PRINT a%, b%
END SUB