Source Insight中快速添加注释

使用说明: 可以实现在sourceinsight中快速添加修改注释。 1. Project->Open Project... 打开Base工程(该工程一般在我的文档//Source Insight//Projects//Base中); 2. 搜索utils.em 里的字串"chenjsa" 改成自己的姓名 3. Project->Add and Remove Project Files... 加入宏文件(即utils.em); 4. Options->Menu Assignments 打开Menu Assignments窗口, 在Command中输入Macro, 选中要使用的宏(SingleLineComment ,MultiLineCommentHeader,MultiLineCommentEnd), 添加到合适的菜单中. macro SingleLineComment() { szMyName = "gs06116" // Get a handle to the current file buffer and the name // and location of the current symbol where the cursor is. hbuf = GetCurrentBuf() ln = GetBufLnCur(hbuf) // Get current time szTime = GetSysTime(1) Hour = szTime.Hour Minute = szTime.Minute Second = szTime.Second Day = szTime.Day Month = szTime.Month Year = szTime.Year if (Day < 10) szDay = "0@Day@" else szDay = Day //szMonth = NumToName(Month) if (Month < 10) szMonth = "0@Month@" else szMonth = Month szDescription = Ask("请输入修改原因") // begin assembling the title string //added by gs06116 InsBufLine(hbuf, ln, "//Added by @szMyName@ @Year@/@szMonth@/@szDay@ for @szDescription@ ") //InsBufLine(hbuf, ln+1, "/*@szDescription@ xmyanfa @Year@-@szMonth@-@szDay@*/") } macro MultiLineCommentHeader() { szMyName = "gs06116" // Get a handle to the current file buffer and the name // and location of the current symbol where the cursor is. hbuf = GetCurrentBuf() ln = GetBufLnCur(hbuf) // Get current time szTime = GetSysTime(1) Hour = szTime.Hour Minute = szTime.Minute Second = szTime.Second Day = szTime.Day Month = szTime.Month Year = szTime.Year if (Day < 10) szDay = "0@Day@" else szDay = Day //szMonth = NumToName(Month) if (Month < 10) szMonth = "0@Month@" else szMonth = Month szDescription = Ask("请输入修改原因:") // begin assembling the title string //added by gs06116 InsBufLine(hbuf, ln, "/*Begin:Added by @szMyName@ @Year@/@szMonth@/@szDay@ for @szDescription@ */") } macro MultiLineCommentEnd() { szMyName = "gs06116" // Get a handle to the current file buffer and the name // and location of the current symbol where the cursor is. hbuf = GetCurrentBuf() ln = GetBufLnCur(hbuf) // Get current time szTime = GetSysTime(1) Hour = szTime.Hour Minute = szTime.Minute Second = szTime.Second Day = szTime.Day Month = szTime.Month Year = szTime.Year if (Day < 10) szDay = "0@Day@" else szDay = Day //szMonth = NumToName(Month) if (Month < 10) szMonth = "0@Month@" else szMonth = Month //InsBufLine(hbuf, ln + 1, "/*@szMyName@.xmyanfa @Year@-@szMonth@-@szDay@ end*/") //added by gs06116 InsBufLine(hbuf, ln, "/*End:Added by @szMyName@ @Year@/@szMonth@/@szDay@ */") } macro DeSingleLineComment() { szMyName = "gs06116" // Get a handle to the current file buffer and the name // and location of the current symbol where the cursor is. hbuf = GetCurrentBuf() ln = GetBufLnCur(hbuf) // Get current time szTime = GetSysTime(1) Hour = szTime.Hour Minute = szTime.Minute Second = szTime.Second Day = szTime.Day Month = szTime.Month Year = szTime.Year if (Day < 10) szDay = "0@Day@" else szDay = Day //szMonth = NumToName(Month) if (Month < 10) szMonth = "0@Month@" else szMonth = Month szDescription = Ask("请输入修改原因") // begin assembling the title string //added by gs06116 InsBufLine(hbuf, ln, "//Deleted by @szMyName@ @Year@/@szMonth@/@szDay@ for @szDescription@ ") //InsBufLine(hbuf, ln+1, "/*@szDescription@ xmyanfa @Year@-@szMonth@-@szDay@*/") } macro DeMultiLineCommentHeader() { szMyName = "gs06116" // Get a handle to the current file buffer and the name // and location of the current symbol where the cursor is. hbuf = GetCurrentBuf() ln = GetBufLnCur(hbuf) // Get current time szTime = GetSysTime(1) Hour = szTime.Hour Minute = szTime.Minute Second = szTime.Second Day = szTime.Day Month = szTime.Month Year = szTime.Year if (Day < 10) szDay = "0@Day@" else szDay = Day //szMonth = NumToName(Month) if (Month < 10) szMonth = "0@Month@" else szMonth = Month szDescription = Ask("请输入修改原因:") // begin assembling the title string //added by gs06116 InsBufLine(hbuf, ln, "/*Begin:Deleted by @szMyName@ @Year@/@szMonth@/@szDay@ for @szDescription@ */") } macro DeMultiLineCommentEnd() { szMyName = "gs06116" // Get a handle to the current file buffer and the name // and location of the current symbol where the cursor is. hbuf = GetCurrentBuf() ln = GetBufLnCur(hbuf) // Get current time szTime = GetSysTime(1) Hour = szTime.Hour Minute = szTime.Minute Second = szTime.Second Day = szTime.Day Month = szTime.Month Year = szTime.Year if (Day < 10) szDay = "0@Day@" else szDay = Day //szMonth = NumToName(Month) if (Month < 10) szMonth = "0@Month@" else szMonth = Month //InsBufLine(hbuf, ln + 1, "/*@szMyName@.xmyanfa @Year@-@szMonth@-@szDay@ end*/") //added by gs06116 InsBufLine(hbuf, ln, "/*End:Deleted by @szMyName@ @Year@/@szMonth@/@szDay@ */") }
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值