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

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
Version           : 1.00 7.10 4.50 | 1.00 2.00 3.00
Platform          : MS-DOS WINDOWS
Solution Type     : kbfix

Last Reviewed: November 1, 1997