How to prefix each line in a selected block of code?

How to prefix each line in a selected block of code?

2

    Aug 05, 2006#1

    Is it possible to prefix each source line with a given character in a selected block of code?
    --

    The SQR programming language uses the exclamation mark (!) as a comment indicator. All characters to the right of the exclamation mark to the end-of-line are treated as comments.

    Unfortunately, SQR does not have a multiple line block comment construct like the classic /* */ convention of many other languages.

    I would like to be able to select a multiple line block of code (via click+dragging the mouse) and then run a macro which would insert an exclamation mark at the beginning of each line.

    If anyone knows how to do this, would they please explain how this can be done? (I can easily record a macro which will insert an exclamation mark, move down one row, and move back one character, positioning itself for another iteration of the same macro, but I don't know how to automatically do this for multiple rows within a selected block.)

    Thanks,
    Jim in Alaska

    112
    Power UserPower User
    112

      Aug 05, 2006#2

      Define a WordFile for the SQR language

      Define the comment character

      Edit|Add Comment and Edit|Remove Comment will do the rest...

      The Wordfile can be pretty minimal...

      HTH,
      Paolo
      There is no such thing as an inconsistently correct system...
      Therefore, aim for consistency; in the expectation of reaching correctness!

      6,686585
      Grand MasterGrand Master
      6,686585

        Aug 05, 2006#3

        Look on this website on the download area under Downloads - Extras - Wordfiles. There you will find PeopleSoft SQR, a syntax highlighting wordfile for SQR. Add the content of the file to your wordfile as described at the download page. The usage is explained already by Paolo.

        1
        NewbieNewbie
        1

          Aug 08, 2006#4

          Select the block of code -
          Toggle COLUMN MODE = ON -
          Type exclamation mark.