(SOLVED) "Ignore this" code ~ General Question

Mar 29, 2009 at 7:35pm
Hey guys,

I am writing this code, and I just want to make sure one part of the code works while another part is incomplete. How can I have it so that a segment of the code is ignored in the compiling process?

I know it's possible, I've seen people do it, but I can't remember what they wrote.

Thanks!
Last edited on Mar 29, 2009 at 7:47pm
Mar 29, 2009 at 7:46pm
You can "comment" lines to make them not used by prepending // or ignore many lines by putting /* at the beginning and */ at the end of what you want ignored. sometimes people will also use #if FALSE and #endif to block out what they don't want. I suppose this is to not cause issues with the /* */ comments
Last edited on Mar 29, 2009 at 7:46pm
Mar 29, 2009 at 7:47pm
Alright, this can come in handy, especially when dealing with longer codes.
Thank you!
Mar 29, 2009 at 8:54pm
Yeah, sometimes people use #if FALSE etc because of things like this:

1
2
3
4
5
6
7
/*if (stuff) {
   blah
   blah
   /*blah
   blah*/
   blah
}*/


It will stop after the 4th blah, causing problems.
Apr 3, 2009 at 12:36am
firedraco: It stops ignoring after the fifth line of code? Although the /* and */ is 'ignoring' line 1 to 7?
Apr 3, 2009 at 2:04am
An */ ending comment block operator doesn't act like a brace. One will cancel out 20 starting /* comment block operators
Last edited on Apr 3, 2009 at 2:04am
Topic archived. No new replies allowed.