FIX: Type Mismatch Error If Use VAL Function on Big Hex Value

Last reviewed: October 30, 1997
Article ID: Q95431
1.00 7.10 4.50 | 1.00 2.00 3.00
MS-DOS         | WINDOWS
kbprg kbbuglist

The information in this article applies to:

- Standard and Professional Editions of Microsoft Visual Basic for

  Windows, versions 2.0 and 3.0
- Microsoft Visual Basic programming system for Windows, version 1.0 - Standard and Professional Editions of Microsoft Visual Basic
  for MS-DOS, version 1.0
- Microsoft Basic Professional Development System (PDS) for MS-DOS,
  version 7.1
- Microsoft QuickBASIC for MS-DOS, version 4.5

SYMPTOMS

Using the VAL function on a large hexadecimal number (greater than or equal to the hexadecimal value 80000000) embedded in a string can incorrectly cause a "Type mismatch" error. This occurs only when the hexadecimal number contains an ampersand (&) at the end of the string.

WORKAROUND

To reproduce the problem run the following code:

   PRINT VAL("&H80000000&")

You get a "Type mismatch" error. To prevent the error, remove the last ampersand (&) character.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This problem has been corrected in Visual Basic version 4.0.


Additional reference words: buglist2.00 buglist1.00 buglist4.50 buglist7.10
buglist3.00 1.00 2.00 3.00 4.50 7.10 fixlist4.00
KBCategory: kbprg kbbuglist
KBSubcategory: PrgOther
Keywords : PrgOther kbbuglist kbprg
Version : 1.00 7.10 4.50 | 1.00 2.00 3.00
Platform : MS-DOS WINDOWS
Solution Type : kbfix


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.

Last reviewed: October 30, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.