Write comments using macros

Source: Internet
Author: User

Auto-assign by macroProgramAdd comments .. add comments to each function, class, and file. because I found some of these things are the same. it also takes time to make comments nice and clear. At this time, we can use macros to help us. for example, I have defined two macros. One is to annotate the file (corresponding to the Hot Key Alt + H), and the other is to annotate the function (corresponding to the Hot Key Alt + F ). the results are as follows:
Where you need to add comments, press Alt + H to display the following items.
/*---------------------------------------------------------
Module name:
Author:

--------------------------------------------------------*/
Where you need to add comments, press Alt + F to display the following items.
/*-----------------------------------------------------------
Purpose:

Parameter:
Date:

modify:
------------------------------------------------------------ */
In fact, this can be easily done using macros. the specific operation is as follows: menu item "tools-> macro", click OK (;) in the pop-up window, you seem to have nothing else to do), and then come out to a window, click "record" and ask you to give a name to the macro you want to record. It is actually a function name in the macro file, and you will know what to do once you get it, such as "functioncomment ", it is used to annotate the function. then the recording starts. in the previous CPP or any other files that can be edited, enter the format above, for example: (do whatever you want to do. it looks comfortable. after entering the key, click "stop" on the toolbar of the macro recording. you can see that the recorded macro script (VBScript) was written. I only modified one place, that is, added a now function after the date, and obtained the newly added comment. Return to the previous dialog box (that is, the one with a record). How can this problem be solved? Click "Again". If you see " /* Tables
purpose:
parameter:
date:
modify:
-------------------------------------------------------- */

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.