Block Comment

Block Comment

2
NewbieNewbie
2

    Sep 23, 2004#1

    Has anyone written a macro that will perform a block comment on a section of highlighted code.

    ex.
    if(something)
    {
    dothis++;
    }

    if(something)
    {
    dothis++;
    }


    /** if(something) **/
    ** { **
    ** dothis++; **
    ** } **/

    Well, the comments would line up but its not working so well in the forum editor. You can get the idea though.

    Thank you for any help or ideas.

    Doug

    6,681583
    Grand MasterGrand Master
    6,681583

      Sep 23, 2004#2

      Do you know about Edit - Comment Add and Comment Remove, which can also be assigned to hotkeys. This will add or remove a line comment on each selected line. Ok, it is not a block comment, but the result is the same.

      To temporary remove a C code section I normally use
      #ifdef TRASH
      Code
      #endif

      TRASH is not defined and so the code is ignored during compilation. I like this more, because the removed section is still highlighted normally, which is a big advantage, if I have to look at it again. Second advantage is, that I can simply search for this "comments" before creating a release version, to check, if I can delete it now or I have forgotten something to change back for the release version.

      Edited on 2010-03-02: Starting with UltraEdit v16.00 there are the commands Edit - Comment Selection and Edit - Uncomment Selection to insert/remove block comment on/off strings on the current selection.
      Best regards from an UC/UE/UES for Windows user from Austria