Act on selected text

Act on selected text

3
NewbieNewbie
3

    Feb 25, 2005#1

    I want to write a macro that acts on each line of the selected block of text.
    If I select three lines, I want the macro to add a few characters to the beginning of each line. Anybody willing to provide a little help on how to do this?

    Thanks in advance.

    JayPM

    206
    MasterMaster
    206

      Feb 25, 2005#2

      This is the general idea. If you leave the (.) out of the Find string, it puts the "added" string in twice. I don't know why.



      InsertMode
      ColumnModeOff
      HexOff
      UnixReOn
      Find RegExp "^(.)"
      Replace All SelectText "added\1"
      Software For Metalworking
      http://closetolerancesoftware.com

      3
      NewbieNewbie
      3

        Feb 25, 2005#3

        Hmm.. so, I used your macro text and gave it a try.
        This is my macro:

        InsertMode
        ColumnModeOff
        HexOff
        UnixReOn
        Find RegExp "^()"
        Replace All SelectText "//"
        (add the two slashes to the beginning of each line - I'm editing
        pascal source code, and I want to block comment lines out using UE)

        In a source file I selected 4 lines and invoked the macro
        and get a "Search String Not Found" error. Did I miss
        something??

        206
        MasterMaster
        206

          Feb 25, 2005#4

          Try this:


          Macro > Edit Macro > Modify

          Check the "Continue If A Find With Replace Not Found" box

            Feb 25, 2005#5

            Also, you left the period out in the search string, and the \1 in the replace string.
            Software For Metalworking
            http://closetolerancesoftware.com

            3
            NewbieNewbie
            3

              Feb 25, 2005#6

              InsertMode
              ColumnModeOff
              HexOff
              UnixReOff
              Find RegExp "^(.)"
              Replace All SelectText "//\1"

              (and I made the switch) - but still nothing working.

              -Jay

              206
              MasterMaster
              206

                Feb 25, 2005#7

                Somehow you turned off Unix mode.
                Software For Metalworking
                http://closetolerancesoftware.com

                261
                Basic UserBasic User
                261

                  Feb 28, 2005#8

                  Do you realize that if you have syntax highlighting for Pascal, UE has a command to comment out (or uncomment) a block of text?

                  I added one line to my Wordfile.txt:

                  /L10"Pascal" Line Comment = // File Extensions = .psc

                  (I wasn't sure about the extension for Pascal!)

                  I made a test file with the .psc extension, then highlighted some lines, and did Edit | Comment Add.

                  There are probably full descriptions of Pascal that you can download to do all of the highlighting.

                  Dave
                  ASTTMan
                  I'm not a Texan, I just live here.