Registrations are now open. Join us today!
There is still a lot of work to do on the wiki yet! More information about editing can be found here.
Already have an account?

Microsoft KB Archive/35885

From BetaArchive Wiki
Knowledge Base

LONG INTEGER Overflow Is Not Detected in EXE

Article ID: 35885

Article Last Modified on 11/21/2006


  • 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
  • Microsoft BASIC Professional Development System 7.0
  • Microsoft BASIC Professional Development System 7.1

This article was previously published under Q35885


The program below, when run in the QB.EXE or QBX.EXE editor, correctly generates an "Overflow" message. However, the EXE program incorrectly prints a -2 (even when compiled with the /D (debug) option).


Microsoft has confirmed this to be a bug in QuickBasic versions 4.00, 4.00b, and 4.50; in Microsoft Basic Compiler versions 6.00 and 6.00b (buglist6.00, buglist6.00b) for MS-DOS and MS OS/2; and in Microsoft Basic Professional Development System (PDS) versions 7.00 and 7.10 (buglist7.00, buglist7.10) for MS-DOS and MS OS/2. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.


The following is a code example:

   a& = 2147483647     ' Largest positive long integer
   b& = 2
   x& = a& * b&
   PRINT x&            ' EXE version prints a -2

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

Keywords: KB35885