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
THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.
Copyright Microsoft Corporation 1986-2002.