BUG: Type Mismatch Error Comparing String With Byte Array (190213)
The information in this article applies to:
- Microsoft Visual Basic Learning Edition for Windows 6.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
This article was previously published under Q190213 SYMPTOMS
In Visual Basic, if you have a function returning an array of bytes and you
compare the return value with a string, you get the following error:
Compile Error: Type Mismatch
RESOLUTION
You can bypass this error if you convert the return value of the function
using the function Cstr before comparing it with a string, as in the
following code:
If CStr(myFunc) <> "yes" Then
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products
listed at the beginning of this article. We are researching this
bug and will post new information here in the Microsoft Knowledge
Base as it becomes available.
Modification Type: | Major | Last Reviewed: | 5/13/2003 |
---|
Keywords: | kbbug KB190213 |
---|
|