Microsoft KB Archive/38069

= &quot;Division By Zero&quot; Dynamic, Fixed-Length STRING*1, 64K+ Array =

Article ID: 38069

Article Last Modified on 11/21/2006

-

APPLIES TO


 * Microsoft QuickBasic 4.0
 * Microsoft QuickBASIC 4.0b
 * Microsoft QuickBasic 4.5 for MS-DOS
 * Microsoft BASIC Compiler 6.0
 * Microsoft BASIC Compiler 6.0b

-



This article was previously published under Q38069



SYMPTOMS
A DIM statement gives the following error at run time when you dimension a dynamic, fixed-length STRING*1 array 64K or larger (which requires compiling with the /AH option):

&quot;Division by zero&quot;



STATUS
Microsoft has confirmed this to be a bug in QuickBasic Versions 4.00, 4.00b, and 4.50 and in Microsoft Basic Compiler Versions 6.00 and 6.00b for MS-DOS and MS OS/2 (buglist6.00, buglist6.00b). The &quot;Division by zero&quot; error occurs both in the QB.EXE editor and in a compiled .EXE program. This problem was corrected in Microsoft Basic PDS Version 7.00 (fixlist7.00).

This problem does not occur with static fixed-length STRING*1 arrays, or any static or dynamic array smaller than 64K.



MORE INFORMATION
The following is a code example: ' This program must be compiled with the /AH option. ' A static array (limited to 64K or smaller) is ok: DIM darray(1 TO 4096, 1 TO 16) AS STRING * 1 REM $DYNAMIC ' A dynamic, STRING*1, 64K+ array gives &quot;DIVISION BY ZERO&quot; at run time: DIM carray(1 TO 4096, 1 TO 16) AS STRING * 1

Additional query words: QuickBas BasicCom buglist4.00 buglist4.00b buglist4.50 B_BasicCom

Keywords: KB38069

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.