• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            S.l.e!ep.¢%

            像打了激速一樣,以四倍的速度運轉,開心的工作
            簡單、開放、平等的公司文化;尊重個性、自由與個人價值;
            posts - 1098, comments - 335, trackbacks - 0, articles - 1
              C++博客 :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理

            VC,添加注釋的宏

            Posted on 2009-11-20 22:40 S.l.e!ep.¢% 閱讀(923) 評論(0)  編輯 收藏 引用 所屬分類: VC
            Sub?FILECOMMENT()
            ' DESCRIPTION:?COMMENT?For?file?version
            ActiveDocument.Selection? = ? " /** "
            ActiveDocument.Selection.NewLine
            ActiveDocument.Selection?
            = ? "  *?Name:? "
            ActiveDocument.Selection.NewLine
            ActiveDocument.Selection?
            = ? " *?Copyright:? "
            ActiveDocument.Selection.NewLine
            ActiveDocument.Selection?
            = ? " *?Author:? "
            ActiveDocument.Selection.NewLine
            ActiveDocument.Selection?
            = ? " *?Date:? "
            ActiveDocument.Selection?
            = ?DATE? + ?TIME
            ActiveDocument.Selection.NewLine
            ActiveDocument.Selection?
            = ? " *?Description:? "
            ActiveDocument.Selection.NewLine
            ActiveDocument.Selection?
            = ? " *?Modification:? "
            ActiveDocument.Selection.NewLine
            ActiveDocument.Selection?
            = ? " **/ "
            End?Sub
            Sub?AddFunctionDescription?(?)
            ' DESCRIPTION:?Creates?a?comment?block?for?the?currently?selected?C/C++?function?prototype

            ????
            ' Throughout?this?file,?ActiveDocument.Selection?is?used?in?place?
            ???? ' of?ActiveDocument.Selection.Text.??The?two?are?equivalent,?and?can?
            ???? ' be?used?interchangeably.?The?reason?for?the?equivalence?is?that
            ???? ' Text?is?regarded?as?the?default?property?to?use.?All?uses?of
            ???? ' ActiveDocument.Selection?without?any?other?property?default?to?the?Text
            ???? ' property.
            ???? if ?ActiveDocument.Language? = ?dsCPP?Then
            ????????Header?
            = ?StripTabs(Trim(ActiveDocument.Selection))

            ????????
            ' Get?the?function?return?type.
            ???????? if ?Header? <> ? "" ?then
            ????????????Reti?
            = ?InStr(Header,? " ? " )
            ????????????Loc?
            = ?InStr(Header,? " ( " )
            ????????????
            if ?Reti? < ?Loc?Then
            ??????????????RetTp?
            = ?Left(Header,?Reti)
            ??????????????Header?
            = ?Right(Header,?Len(Header)? - ?Reti)
            ????????????End?If

            ????????????
            ' Get?the?function?name.
            ????????????Loc? = ?InStr(Header,? " ( " )? - ? 1
            ????????????Loc2?
            = ?InStr(Header,? " ) " )
            ????????????
            if ?Loc? > ? 0 ?And?Loc2? > ? 0 ?then? ' make?sure?there?is?a? ' ( ' ?and?a? ' ) '
            ????????????????fcName? = ?Left(Header,?Loc)
            ????????????????Header?
            = ?Right(Header,?Len(Header)? - ?Len(fcName))

            ????????????????
            ' Do?we?have?storage?type?on?the?return?type?
            ????????????????Trim?(fcName)
            ????????????????If?InStr(fcName,
            " ? " )? <> ? 0 ?Then
            ????????????????????retTp?
            = ?retTp? + ?Left(fcName,InStr?(fcName, " ? " ))
            ????????????????????fcName?
            = ?Right(fcName,?Len(fcName)? - ?InStr(fcName, " ? " ))
            ????????????????End?If

            ????????????????
            ' Get?the?function?parameters.
            ????????????????iPrm? = ? 0
            ????????????????iPrmA?
            = ? 0
            ????????????????prms?
            = ?Header?

            ????????????????
            ' Count?the?number?of?parameters.?
            ????????????????Do?While?InStr(prms,? " , " )? <> ? 0
            ????????????????????iPrm?
            = ?iPrm? + ? 1
            ????????????????????prms?
            = ?Right(prms,?Len(prms)? - ?InStr(prms,? " , " ))?
            ????????????????Loop?
            ????????????????
            ????????????????
            ' Store?the?parameter?list?in?the?array.
            ????????????????If?iPrm? > ? 0 ?Then?? ' ?If?multiple?params.
            ????????????????????iPrm? = ?iPrm? + ? 1
            ????????????????????iPrmA?
            = ?iPrm
            ????????????????????Redim?ParamArr(iPrm)
            ????????????????????Do?While?InStr(header,?
            " , " )? <> ? 0
            ????????????????????????ParamArr(iPrm)?
            = ?Left(Header,?InStr?(Header,? " , " )? - ? 1 )
            ????????????????????????
            ' Remove?brace?from?first?parameter.
            ????????????????????????If?InStr(ParamArr(iPrm),? " ?( " )? <> ? 0 ?Then
            ????????????????????????????ParamArr(iPrm)?
            = ?Right(ParamArr(iPrm),?_
            ????????????????????????????????????Len(ParamArr(iPrm))
            - InStr(ParamArr(iPrm), " ?( " ))
            ????????????????????????????Trim(ParamArr(iPrm))
            ????????????????????????End?If
            ????????????????????????Header?
            = ?Right(Header,?Len(Header)? - ?InStr(Header, " , " ))
            ????????????????????????iPrm?
            = ?iPrm? - ? 1 ?
            ????????????????????????Loop?
            ????????????????????ParamArr(iPrm)?
            = ?Header?
            ????????????????????
            ' Remove?trailing?brace?from?last?parameter.
            ????????????????????If?InStr(ParamArr(iPrm),? " ) " )? <> ? 0 ?Then
            ????????????????????????ParamArr(iPrm)?
            = ?Left(ParamArr(iPrm),?_
            ????????????????????????????????InStr(ParamArr(iPrm),?
            " ) " )? - ? 1 )
            ????????????????????????Trim(ParamArr(iPrm))
            ????????????????????End?If
            ????????????????Else?
            ' Possibly?one?param.
            ????????????????????Redim?ParamArr( 1 )
            ????????????????????Header?
            = ?Right(Header,?Len(Header)? - ? 1 )? ' ?Strip?the?first?brace.
            ????????????????????Trim(Header)
            ????????????????????ParamArr(
            1 )? = ?StripTabs(Header)
            ????????????????????If?InStr(ParamArr(
            1 ),? " ) " )? <> ? 1 ?Then
            ????????????????????????ParamArr(
            1 )? = ?Left(ParamArr( 1 ),?InStr(ParamArr( 1 ),? " ) " )? - ? 1 )
            ????????????????????????Trim(ParamArr(
            1 ))
            ????????????????????????iPrmA?
            = ? 1
            ????????????????????End?If
            ????????????????End?If

            ????????????????
            ' Position?the?cursor?one?line?above?the?selected?text.
            ????????????????ActiveDocument.Selection.LineUp
            ????????????????ActiveDocument.Selection.LineDown
            ????????????????ActiveDocument.Selection.StartOfLine
            ????????????????ActiveDocument.Selection.NewLine
            ????????????????????????????????
            ????????????????????????????????Descr?
            = ? ""
            ????????????????????????????????ActiveDocument.Selection?
            = ? " /** "
            ????????????????????????????????ActiveDocument.Selection.NewLine
            ????????????????????????????????ActiveDocument.Selection?
            = ? " ?*?@Function?name:? " ? + ?fcName
            ????????????????????????????????ActiveDocument.Selection.NewLine
            ????????????????????????????????ActiveDocument.Selection?
            = ? " *?@Description??:? "
            ????????????????????????????????ActiveDocument.Selection.NewLine
            ????????????????????????????????????????????????
            ????????????????
            ' Print?the?parameter?list.?
            ????????????????Last? = ?iPrmA
            ????????????????Do?While?iPrmA?
            <> ? 0
            ????????????????????
            ' Remove?a?line?feed?from?any?of?the?arguments.
            ????????????????????If?InStr(ParamArr(iPrmA),?vbLf)? <> ? 0 ?Then
            ????????????????????????ParamArr(iPrmA)?
            = ?Right(ParamArr(iPrmA),?_
            ????????????????????????????????(Len(ParamArr(iPrmA))?
            - ?_
            ????????????????????????????????InStr(ParamArr(iPrmA),?vbLf)))
            ????????????????????????Trim(ParamArr(iPrmA))
            ????????????????????End?If
            ????????????????????ParamArr(iPrmA)?
            = ?StripTabs(ParamArr(iPrmA))
            ????????????????????
            ' If?there?are?2+?parameters,?the?first?parameter?will?
            ???????????????????? ' have?a? ' ( ' ?prepended?to?it,?remove?it?here:
            ???????????????????? if ?iPrmA? = ?Last?AND?Last? <> ? 1 ?then
            ??????????????????????ParamArr(iPrmA)?
            = ?Right(ParamArr(iPrmA),?_
            ????????????????????????????Len(ParamArr(iPrmA))?
            - ? 1 )
            ????????????????????End?If
            ????????????????????ActiveDocument.Selection?
            = ? " *?@Argument?????:? " ? + ?_
            ????????????????????????????ParamArr(iPrmA)?
            ????????????????????????????????????????ActiveDocument.Selection.NewLine
            ????????????????????iPrmA?
            = ?iPrmA? - ? 1
            ????????????????Loop

            ????????????????????????????????ActiveDocument.Selection?
            = ? " *?@Return?type??:? " ? + ?RetTp
            ????????????????????????????????ActiveDocument.Selection.NewLine
            ????????????????????????????????ActiveDocument.Selection?
            = ? " */ " ?
            ????????????????????????????????ActiveDocument.Selection.NewLine

            ????????????????
            ' ActiveDocument.Selection?=?Descr
            ????????????Else
            ????????????????MsgBox(
            " It?is?possible?that?the?function?you?are?trying?to " + _
            ????????????????????????
            " ?work?with?has?a?syntax?error. " )
            ????????????End?
            if
            ????????End?If
            ????Else
            ????????MsgBox(
            " You?need?to?have?an?active?C/C++?document?open " + ?_
            ????????????????vbLF
            + " with?the?function?prototype?selected. " )
            ????End?If
            End?Sub

            伊人色综合久久天天| 国产精品成人久久久| 亚洲国产精品无码久久一区二区| 国产 亚洲 欧美 另类 久久| 精品永久久福利一区二区| 久久国语露脸国产精品电影| 大香伊人久久精品一区二区| 97精品伊人久久大香线蕉| 伊人 久久 精品| 国内精品伊人久久久影院| 色狠狠久久综合网| 欧美国产成人久久精品| 中文字幕亚洲综合久久菠萝蜜| 99久久免费国产精品特黄| 国产精品久久久久久久久软件 | 国产精品欧美久久久久无广告| 久久久久综合网久久| 久久国产高清一区二区三区| 久久国产成人午夜AV影院| 大香伊人久久精品一区二区| 久久久精品人妻一区二区三区四 | 亚洲七七久久精品中文国产| 亚洲精品成人久久久| 中文字幕热久久久久久久| 久久久亚洲欧洲日产国码aⅴ| 久久亚洲综合色一区二区三区| 久久久精品久久久久久| 中文字幕无码精品亚洲资源网久久| 国产精品一久久香蕉产线看| 久久久久久无码国产精品中文字幕 | 久久AAAA片一区二区| 久久精品国产亚洲αv忘忧草| 99久久国产综合精品麻豆| 久久93精品国产91久久综合| 热re99久久6国产精品免费| 久久91精品国产91久久户| 久久久久久久综合狠狠综合| 青青草国产精品久久| 99久久精品免费看国产一区二区三区| 亚洲国产精品人久久| 日韩精品久久久肉伦网站|