Microsoft KB Archive/72600

= BC.EXE &quot;Math Overflow&quot; May Flag Incorrect Line of Code =

Article ID: 72600

Article Last Modified on 11/21/2006



This article was previously published under Q72600



SYMPTOMS
When BC.EXE gives a &quot;Math Overflow&quot; error message at compile time, it may flag the incorrect line of source code.



STATUS
Microsoft has confirmed this to be a bug in the BC.EXE compiler provided with Microsoft QuickBasic version 4.5 for MS-DOS (buglist4.50), and with Microsoft Basic Professional Development System (PDS) versions 7.0 and 7.1 for MS-DOS and MS OS/2 (buglist7.00, buglist7.10). We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.



MORE INFORMATION
The workaround is to locate the nearest upwards line where the compile-time &quot;Math Overflow&quot; is most likely to have occurred. In the example below, 32768 exceeds the allowed limits for the integer variable MaxBuff% (which can range from -32768 to +32767). [You can correct the programming error by changing MaxBuff% to a long integer, MaxBuff&, which can range from -2,147,483,648 to +2,147,483,647.]

When the following code is compiled with BC.EXE from QuickBasic 4.5 or from Basic PDS 7.0 or 7.1, a &quot;Math Overflow&quot; error message properly occurs, but the compiler indicates the error on the variable BuffCount& rather than the correct variable MaxBuff%. MaxBuff% = 32768 FOR i& = 1& TO BuffCount& NEXT END

Additional query words: QuickBas BasicCom 7.00 7.10 buglist4.50

Keywords: KB72600

-

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

© Microsoft Corporation. All rights reserved.