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

ID: Q95431


The information in this article applies to:
  • Microsoft Visual Basic Standard and Professional Editions for Windows, versions 2.0, 3.0
  • Microsoft Visual Basic programming system for Windows, version 1.0
  • Microsoft Visual Basic Standard and Professional Editions for MS-DOS, version 1.0
  • Microsoft Basic Professional Development System 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 query words: buglist2.00 buglist1.00 buglist4.50 buglist7.10 buglist3.00 2.00 3.00 4.50 7.10 fixlist4.00

Keywords : PrgOther
Version : 1.00 7.10 4.50 | 1.00 2.00 3.00
Platform : MS-DOS WINDOWS
Issue type :


Last Reviewed: September 16, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.