Click here to Skip to main content
11,496,146 members (762 online)
Click here to Skip to main content

Code usability

, 16 Dec 2002 129.9K 317 14
Macro to add description to any function written by developers.
The site is currently in read-only mode for maintenance. Posting of new items will be available again shortly.
<!-- Download Links -->

This VB procedure helps any developer to easily add comments to his/her code. The comments including some function details like function name, input parameter and return value. Also, the date when the function was written and the author name. All are retrieived automatically and it saves the developer time.

How does it work?

  • The developer marks the function she wants to remark.
  • The code parses the selected text and gets all of the relevant data from the function (i.e. name,input and return value)
  • The description should be filled by the author
  • Date is written as the current date
  • Author is taken by the Windows login name

How can you use it?

    • Open VC
    • Go to Tools->Customize->Commands->Macros
    • On the right pane click on the function AddFunctionDescription (should be the 1'st one), then drag it to the toolbar.
    • You should see this function in the toolbar
    • Go to Tools->Macors->Macro explorer
    • In the tree, open Samples->DevStudio6Editor
    • Right Click on AddFunctionDescription and choose Edit
    • Replace the current code of this procedure with the one you have in the attached zip file.
    • Save all the changes in all of the IDEs
    • Select any function you have in the code (select the whole row)
    • Click on the AddFunctionDescription button in the toolbar
    • You will see the proper remark
    • Sample: Supposed that you have the function void Foo(int bar) written by a guy
    • named Henry. This macro will add the next lines just below you selected
    • function.
    • // ********************************************************************
    • // Function name : Foo
    • // Description :
    • // Return type : void
    • // Argument : bar
    • //
    • // Date : 1:10PM 12/13/2002
    • // Author : henry
    • // ********************************************************************

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

oferudi

Israel Israel
No Biography provided

Comments and Discussions

 
GeneralIt doesn't work Pin
MikeTheProgrammer21-Sep-03 2:36
memberMikeTheProgrammer21-Sep-03 2:36 
GeneralC#.NET already has automatic comment ability... Pin
Marc Clifton17-Dec-02 2:14
memberMarc Clifton17-Dec-02 2:14 
GeneralRe: C#.NET already has automatic comment ability... Pin
Michael P Butler19-Dec-02 1:04
memberMichael P Butler19-Dec-02 1:04 
GeneralRe: C#.NET already has automatic comment ability... Pin
Lennybacon23-Dec-02 11:09
memberLennybacon23-Dec-02 11:09 
GeneralRe: C#.NET already has automatic comment ability... Pin
Hades5k20-Sep-07 8:29
memberHades5k20-Sep-07 8:29 
GeneralA revision history might be useful Pin
Marc Clifton17-Dec-02 1:57
memberMarc Clifton17-Dec-02 1:57 
QuestionWhere is a StripTabs? Pin
_Samael_16-Dec-02 2:39
member_Samael_16-Dec-02 2:39 
Generalsuggestions Pin
Henry Jacobs13-Dec-02 8:41
memberHenry Jacobs13-Dec-02 8:41 
I agree with others that the article needs some improvement. However, I will offer constructive criticism.

I think an example of the input and output would help to avoid abrupt conclusions about the worth of this article. I have not tried the macro yet (I'm at work) but I looked at the code, it generates C++ comments using a VB macro.

VB is not my native language but the output is something like this (based on the code void Foo(int bar)):
//  ********************************************************************
//  Function name   : Foo
//  Description     : 
//  Return type     : void
//  Argument        : bar
//
//  Date            : 1:10PM 12/13/2002
//  Author          : henry
//  ********************************************************************
I suggest moving this article to “Macros and Add-ins.” Also, a more descriptive title would help others to locate it better (e.g. “Generate a Function Comment Header from the Function Definition”).

GeneralRe: suggestions Pin
oferudi16-Dec-02 20:42
memberoferudi16-Dec-02 20:42 
GeneralRe: suggestions Pin
jhwurmbach16-Dec-02 22:39
memberjhwurmbach16-Dec-02 22:39 
GeneralNot being picky Pin
Norm Almond12-Dec-02 22:11
memberNorm Almond12-Dec-02 22:11 
GeneralRe: Not being picky Pin
David Stone14-Dec-02 8:56
memberDavid Stone14-Dec-02 8:56 
GeneralPlease reformat the text of your article Pin
Matthias Mann12-Dec-02 3:29
memberMatthias Mann12-Dec-02 3:29 
GeneralRe: Please reformat the text of your article Pin
leppie12-Dec-02 9:10
memberleppie12-Dec-02 9:10 
GeneralRe: Please reformat the text of your article Pin
Uwe Keim12-Dec-02 21:08
sitebuilderUwe Keim12-Dec-02 21:08 
GeneralRe: Please reformat the text of your article Pin
Norm Almond12-Dec-02 22:13
memberNorm Almond12-Dec-02 22:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150520.1 | Last Updated 17 Dec 2002
Article Copyright 2002 by oferudi
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid