"COMMON in Quick Library Too Small": Use NAMED COMMON (43698)



The information in this article applies to:

  • Microsoft QuickBASIC 4.0
  • Microsoft QuickBASIC 4.0b
  • Microsoft QuickBASIC 4.5

This article was previously published under Q43698

SUMMARY

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.0, 4.0b, and 4.5, to the QB.EXE environment shipped with Microsoft Basic Compiler versions 6.0 and 6.0b, and to the QBX.EXE environment shipped with Microsoft Basic PDS versions 7.0 and 7.1.

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.

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
				

Quick Library TEST.QLB

COMMON a%, b%            'workaround: COMMON /qlbcommon/ a%, b%

SUB Test

PRINT a%, b%

END SUB
				

Modification Type:MinorLast Reviewed:1/8/2003
Keywords:KB43698