zoukankan      html  css  js  c++  java
  • 为VC++6.0 添加批量注释和批量取消注释 vcscript脚本

    '------------------------------------------------------------------------------
    'FILE DESCRIPTION: 为开发环境添加批量注释或取消注释
    '------------------------------------------------------------------------------
    Sub SetSelNote() 'Sun DESCRIPTION:过程SetSellNote用于将选中的文本转换为注释
        dim CurWin
        set CurWin = ActiveWindow
        if CurWin.type<>"Text" Then
            MsgBox "当前窗口不是代码窗口"
        else
            NoteType = "//"
            BeginLine = ActiveDocument.selection.TopLine
            EndLine = ActiveDocument.Selection.BottomLine
            if EndLine < BeginLine Then
                line = BeginLine
                BeginLine = EndLine
                EndLine = Line
            else
                for row = BeginLine To EndLine
                    ActiveDocument.Selection.GoToLine row
                    ActiveDocument.Selection.SelectLine
                    ActiveDocument.Selection = NoteType+ActiveDocument.Selection
                Next
            End if
        End if
    End Sub
    
    Sub CancelSelNote()
        dim CurWin
        set CurWin = ActiveWindow
        if CurWin.type<>"Text" Then
            MsgBox "当前窗口不是代码窗口"
        else
            BeginLine = ActiveDocument.Selection.TopLine
            EndLine = ActiveDocument.Selection.BottomLine
            if EndLine < BeginLine Then
                Line = BeginLine
                BeginLine = EndLine
                EndLine = Line
            else
                for row = BeginLine To EndLine
                    ActiveDocument.Selection.GoToLine row
                    ActiveDocument.Selection.SelectLine 
                    SelBlock = ActiveDocument.Selection
                    Trim(SelBlock)
                    pos = instr(SelBlock, "//")
                    if pos <> 0 then
                        RightBlock = Right(SelBlock, Len(SelBlock)-2)
                        ActiveDocument.Selection = RightBlock
                    End if
                Next
            End if
        End if
    End Sub
  • 相关阅读:
    java后端解决请求跨域
    在IDEA中找不到Mapper报错
    ES6拼接数组与小程序本地存储
    小程序云开发实现微信发说说
    SQLServer的操作以及一些概念
    数据依赖(决定),码,范式,规范化与反规范化
    Git的使用上传与下载github
    JS中Map和ForEach的区别
    进入React的世界
    Node的重要性
  • 原文地址:https://www.cnblogs.com/pythonschool/p/2726415.html
Copyright © 2011-2022 走看看