Block Comment

This forum is user-to-user based and not regularly monitored by IDM.
Please see the note at the top of this page on how to contact IDM.

Block Comment

Postby dougrilee » Thu Sep 23, 2004 7:44 am

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
User avatar
dougrilee
Newbie
 
Posts: 2
Joined: Wed Sep 22, 2004 11:00 pm
Location: Yorktown, Virginia USA

Re: Block Comment

Postby Mofi » Thu Sep 23, 2004 8:22 am

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.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4054
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna


Return to UltraEdit General Discussion