BUG: "On Error Resume Next" Enters Infinite Loop in Native Code (193036)
The information in this article applies to:
- Microsoft Visual Basic Learning Edition for Windows 5.0
- Microsoft Visual Basic Learning Edition for Windows 6.0
- Microsoft Visual Basic Professional Edition for Windows 5.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 5.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
This article was previously published under Q193036 SYMPTOMS
After compiling to native code, a Visual Basic application using "On Error
Resume Next" together with a For loop may sometimes enter an infinite loop
when running as a standalone executable.
RESOLUTION
To work around this behavior, the code can be restructured. The code
provided below resolves the problem for the code that reproduces this bug
in the "Steps To Reproduce Behavior" section of this article:
Public Sub Form_Load()
On Error Resume Next
Dim x As Integer
Dim z as integer
Dim mArray as Variant
z = UBound(mArray)
For x = 0 To z
MsgBox "clear"
Next x
End Sub
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article.
Modification Type: | Major | Last Reviewed: | 5/12/2003 |
---|
Keywords: | kbBug kbCompiler kbpending KB193036 |
---|
|