Static Common Array Greater than 65510 Bytes May Hang Computer (94781)



The information in this article applies to:

  • Microsoft Visual Basic for MS-DOS
  • Microsoft Basic Professional Development System for MS-DOS 7.1
  • Microsoft QuickBASIC 4.5

This article was previously published under Q94781

SYMPTOMS

Attempting to create a static Common array greater than 65510 in the interpreter environment may cause the computer to hang (stop responding). You should instead get an Out of memory error message. Compiling a program that does this results in the correct error messages.

WORKAROUND

To work around the problem, use dynamic arrays instead of static arrays by using Rem $DYNAMIC at the beginning of your program.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Problem

  1. Start the interpreter environment (VBDOS.EXE, QBX.EXE, or QB.EXE).
  2. Type the following code in the Code Window.
          Rem $STATIC
          Dim A%(1 to 32756)
          Common A%()
    						
  3. Run the program.
At this point your computer will hang (stop responding).

Modification Type:MinorLast Reviewed:8/16/2005
Keywords:KB94781