View Full Version : Commenting out in EasyC?
P1h3r1e3d13
20-02-2006, 01:02
Anyone know if putting in two User Code blocks with "/*" and "*/" (sans quotes) will work to comment out the blocks in-between?
I want to comment out large chunks of code including conditions (if, while, etc.) and without having to click on every block.
Edit: Oops!:o I forgot there was a separate EasyC forum. Mods, wanna move this? Sorry.
Matt Krass
20-02-2006, 02:51
EDIT: I'm not entirely postive that will work in EasyC, it's standard C so I think it will. Let me know if it does?
Instead of doing /* and */ do this
Old way:
/*
int myvar = 0;
Default();
Code();
DoStuff();
*/
Better way:
#if 0 // Will never be satisfied
int myvar = 0;
Default();
Code();
DoStuff();
#endif
Pre-processor directives won't be succeptible to comment blocks in the block you're trying to comment. Good luck!
P1h3r1e3d13
20-02-2006, 15:14
Aha - good idea!
if (0)
{
I would have thought of that.
}
Thanks
edit:
Is there no way then to comment out (or otherwise render irrelevant) one "elseif" from the middle of a string of them?
Francis-134
20-02-2006, 15:50
A very easy way to comment out blocks is to simply right click them, then hit "comment out block". From my experience, this does not work with entire, long statements such as an if, else, for etc., but it will work with individual blocks and user functions.
P1h3r1e3d13
20-02-2006, 19:22
Thanks - I'd gotten that part, but as you noted, it doesn't work on conditions, and you can't comment out multiple blocks in one fell swoop.
P1h3r1e3d13
20-02-2006, 19:26
Oops!
I just realized I put this in the wrong forum - sorry, mods.
Could the EasyC forum (and its subforums, natch) be itself made a subforum of the programming forum. That would seem to make more sense; I know I would have found it that way.
Kingofl337
22-02-2006, 10:21
*/ and /*
works very well in the User Code Block
P1h3r1e3d13
24-02-2006, 15:27
Oh good - thanks.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.