Q27496: "Overflow" Error Using QLBDUMP.BAS with Large Quick Library
Article: Q27496 Product(s): See article Version(s): 4.00 4.00b 4.50 Operating System(s): MS-DOS Keyword(s): ENDUSER | B_BasicCom buglist4.00 buglist4.00b buglist4.50 | mspl13_basic Last Modified: 25-APR-1990 When running the program QLBDUMP.BAS, large Quick libraries can cause an "Overflow" error. The error occurs in the following line: QHdrPos = (EHdr.CParHdr + EHdr.CS) * 16 + EHdr.IP + 1 This error can be corrected by making the 16 into a long-integer constant. To do this, change the line to read as follows: QHdrPos = (EHdr.CParHdr + EHdr.CS) * 16& + EHdr.IP + 1 Alternatively, you can invoke the CLNG function as follows: QHdrPos = CLNG(EHdr.CParHdr + EHdr.CS) * 16 + EHdr.IP + 1 Microsoft has confirmed this to be a problem in the QLBDUMP.BAS program example provided 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). This problem was corrected in Microsoft BASIC Professional Development System (PDS) Version 7.00 for MS-DOS and MS OS/2 (fixlist7.00). The problem occurs because the calculations on the right-hand side of the equation are being done in normal-integer math, even though the result is to be stored in a long-integer variable. Making the 16 a long integer forces the right-hand side of the equation to do its math in long-integer format. The QLBDUMP program lets you display the routines that are stored in a .QLB Quick library. The QB.EXE editor uses Quick libraries for calling external routines. Quick libraries (.QLB files) have no other purpose.
THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.
Copyright Microsoft Corporation 1986-2002.