Why VB Sub Might Stay in Proc: List Even After Code Deleted

ID Number: Q73270

1.00

WINDOWS

buglist1.00

Summary:

In a Visual Basic code window, if you want to delete the code for a

Sub...End Sub procedure (or Function...End Function procedure), you

must also delete the two or more blank lines (if any) following that

procedure, or else that procedure will still exist (in a blank code

window and in the Proc: box).

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

version 1.0 programming system for Windows. We are researching this

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

To work around this problem, make sure to delete all blank lines in

the code window for the procedure that you want to delete.

More Information:

Steps to Reproduce Problem

--------------------------

1. Start Visual Basic (or select New Project from Visual Basic's File

menu if you are already in Visual Basic).

2. Double-click Form1, or press F7, to display the form's Code window.

3. Choose (general) from the Object: box, and enter the statement

Sub Sub1 in the (general) (declarations) code window, and press the

ENTER key. This causes Visual Basic to display the following Sub

procedure:

Sub Sub1()

End Sub

4. Press CTRL+END, or click to the blank line after the End Sub

statement.

5. Press the ENTER key to add a few blank lines after the End Sub

statement.

6. Using the mouse, select (highlight) from the Sub Sub1() statement

to the End Sub statement (but to duplicate the problem, don't

highlight the blank lines after the End Sub statement). From the

Edit menu, choose Delete, or press the DEL key, to delete the

selected text.

7. Now the Proc: box still indicates that Sub1 exists as a procedure,

even though you just tried to delete it.

This problem is caused by the blank lines that were added after the

End Sub statement. To work around the problem, highlight and delete

the blank lines in the Sub1 code window, and the Sub1 procedure will

be properly deleted.

Additional reference words: 1.00