Code Causing Run-Time Error Can Be Hidden If in Split Window

ID Number: Q73156

1.00

WINDOWS

buglist1.00

Summary:

Under certain circumstances, using a split window in the Visual Basic

environment can hide the code, which results in a run-time error.

Microsoft has confirmed this to be a problem in Microsoft Visual Basic

programming system version 1.0 for Windows. We are researching this

problem and will post new information here as it becomes available.

To work around the problem, use step 8 shown below.

More Information:

The following example demonstrates a problem using split screens

in Microsoft Visual Basic programming system version 1.0 for Windows:

1. Start Visual Basic, and from the File menu choose New Project.

2. Using the mouse, double-click on Form1; the Code window will

display.

3. From the Code window, press the Maximize button so the entire

screen displays Form1's Code window.

4. Select the split window bar, and click and drag the split

window down to about two inches from the bottom of the screen.

5. The Sub Form_Click() should be displayed in the lower half of the

split window. Enter the following code:

Sub Form_Click()

Print 1/0 'enter this line

End Sub

6. Now run the sample code by choosing Start from the Run menu or

by pressing the F5 function key.

7. After choosing Start from the Run Menu, click the Form1 window;

a "Division by zero" error will display. The error occurs because

of the "Print 1/0" statement coded above, but you cannot see the

line of code where the error occurred.

8. If you click on the Maximize button for FORM1.FRM, you will see that

the error occurs on the Print 1/0 statement. Use this method to work

around the problem.

Additional reference words: 1.00