source insight插入文件头

来源:互联网 发布:1688传淘宝后无法上架 编辑:程序博客网 时间:2024/04/29 17:35


macro InsertFileHeader()
{
 //get crrunt time
 szTime = GetSysTime(1)
 Day = szTime.Day
 Month = szTime.Month
 Year = szTime.Year
 hbuf = GetCurrentBuf()//申请变量空间,Get a handle to the current file buffer and the name
 PathName = GetBufName(hBuf)
 FileName = GetFileName(PathName)


 hbuf = GetCurrentBuf()
 InsBufLine(hbuf, 0, " /*")
 
 InsBufLine(hbuf, 1, "*------------------------------------------------------------------------------")
 InsBufLine(hbuf, 2, "* \@file      :    @FileName@")
 InsBufLine(hbuf, 3, "* \@author    :    FE  ")
 InsBufLine(hbuf, 4, "* \@date      :    @Year@-@Month@-@Day@")
 InsBufLine(hbuf, 5, "* \@brief     :    ")
 InsBufLine(hbuf, 6, "* \@attention :    ")
 InsBufLine(hbuf, 7, "*------------------------------------------------------------------------------")
 InsBufLine(hbuf, 8, "* Modification History")
 InsBufLine(hbuf, 9, "* DATE        NAME             DESCRIPTION")  
 InsBufLine(hbuf, 10,"*------------------------------------------------------------------------------")
 InsBufLine(hbuf, 11,"*")
 InsBufLine(hbuf, 12,"*------------------------------------------------------------------------------")
 InsBufLine(hbuf, 13, " */")
}


macro InsertHeader()
{

 hwnd = GetCurrentWnd()
 lnFirst = GetWndSelLnFirst(hwnd)
 hbuf = GetCurrentBuf()
 InsBufLine(hbuf, lnFirst, "/*")
 InsBufLine(hbuf, lnFirst+1, "******************************************************************************")
 InsBufLine(hbuf, lnFirst+2, "*\@ Description    :  ")
 InsBufLine(hbuf, lnFirst+3, "*\@ Parameters     :  ")
 InsBufLine(hbuf, lnFirst+4, "*\                 :  [IN]  ")
 InsBufLine(hbuf, lnFirst+5, "*\                 :  [OUT] ")
 InsBufLine(hbuf, lnFirst+6, "*\@ Return         :  成功: 失败: ")
 InsBufLine(hbuf, lnFirst+7, "*\@ Other          :  ")
 InsBufLine(hbuf, lnFirst+8, "*\@author          :  Z01848  ")
 InsBufLine(hbuf, lnFirst+9,"******************************************************************************")
 InsBufLine(hbuf, lnFirst+10, "*/")


}

0 0
原创粉丝点击