Microsoft KB Archive/193019

= BUG: Type Mismatch Error Erasing a Fixed-Size Array in UDT =

Article ID: 193019

Article Last Modified on 5/13/2003

-

APPLIES TO


 * Microsoft Visual Basic 6.0 Learning Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition

-



This article was previously published under Q193019



SYMPTOMS
When you use the Erase Statement to empty a fixed-size array in a variant UDT, the following error occurs:

"Runtime Error 13: Type Mismatch".



STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.



Steps to Reproduce Behavior
 Create a new ActiveX EXE project. Class1 is created by default.  Paste the following code in Class1: Type test x(5) As Integer End Type  Add a standard module to the project by selecting "Add Module" from the "Project" menu.  Paste the following code in Module1: Sub main Dim x As test x.x(0) = 5 MsgBox x.x(0) Erase x.x        MsgBox x.x(0)

Dim y As Variant y = x        y.x(0) = 5 MsgBox y.x(0) Erase y.x        'fails MsgBox y.x(0) End Sub  Open the Immediate Window by selecting it from the View menu. In the Immediate Window, type "main" (without quotes) and press the ENTER key. After the message boxes "5","0","5" are displayed, the above error will occur on the "Erase y.x" line, instead of emptying the array elements.</li></ol>

Additional query words: kbdss kbDSupport kbVBp kbVBp600bug kbNoKeyWord

Keywords: kbbug KB193019

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.