Microsoft KB Archive/189623

= How To Give Descriptions to Private Procedures =

Article ID: 189623

Article Last Modified on 7/1/2004

-

APPLIES TO


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

-



This article was previously published under Q189623



SUMMARY
Descriptions are generally given to Public procedures and provide more information concerning that particular procedure, which can be seen in the Object Browser. It is possible to provide descriptions for your Private procedures also.



MORE INFORMATION
If you want to give a description to a Public procedure (Sub, Function, Property, Event) you can use the Procedure Attributes dialog. Just select Procedure Attributes from the Tools Menu, select the procedure Name, and type in a description. The description will show up in the Object Browser.

If, however, you try to give a description to a Private procedure when you bring up the Procedure Attributes dialog, your Private procedure won't show up in the list of available procedures. You have to make the procedure Public first, give it a description, then go back and change it to Private. The Object Browser will then display the text.

If you would like to delete the description for the procedure, you could repeat the process, removing the text. You could also cut and paste the code. When you cut and paste code, you lose the description.

Steps to Reproduce Behavior
 Open a new Standard EXE project in Visual Basic. Form1 is created by default.  Add the following code to the Form1 code module: Public Sub MyProcedure MsgBox "MyProcedure" End Sub  While you are still in the code window, select Procedure Attributes from the Tools window. Enter a description for the procedure. Press the F2 key or select Object Browser from the View menu. Search for MyProcedure and view the description you provided at the bottom of the window. Close the Object Browser.  Modify your procedure to look like the following: Private Sub MyProcedure MsgBox "MyProcedure" End Sub  Attempt to perform step 3. Note that you can no longer enter a description for this procedure. Perform step 4. Note that the description is still viewable in the Object Browser.</li></ol>

Additional query words: kbDSupport kbDSD kbVBp kbVBp500 kbNoKeyWord kbVBp600

Keywords: kbhowto KB189623

-

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

© Microsoft Corporation. All rights reserved.