Moderately on topic: If you want to do commenting in and out of code
during testing, the trick I've found is to use "/**/"

For instance...

1:      printf( "line 1" );
2: /**/
3:      printf( "line 2" );
4: /**/
5:      printf( "line 3" );

If you want to temporarily comment out #3, you remove the last "/" from
#2 so that it looks like:
2: /**

...and it's commented out; you don't have to touch #4. Sure beats having
to add/remove whole lines of remark tags.

Tnx & Rgds...
David Flor ( [EMAIL PROTECTED] )
Planning Group International
305-253-0100


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of Pat Magnan
Sent: Thursday, November 15, 2001 3:46 AM
To: [EMAIL PROTECTED]
Subject: RE: [hlcoders] #if 0 #endif -- isn't a /* */ 'better form'?


Cool. There is a reason to do that that escaped me. Haven't come across 
that scenario yet, but hey, I'll keep looking, I'm sure there's a file 
or two in there I've never looked at ;)

  

> > Perhaps there's a reason for doing this that escapes me though.
> 
> If you have /* */s in the cuntion already, the */ will terminate the
block
> function and force you to go back and add more /*s, which is a pain.
Take
> this for example:
> 
> doBlah(vec1, vec2);
> /* Commented...
>   doBlah2(vec2, vec3, length);
> */
> doBlah3(length);
> 
> If you wanted to get rid of this whole block by commenting it out
with /*
> */, VC will interpret the end of the comment at the first */, leaving 
> doBlah3 to possibly wreak havoc. With #if 0, the block is removed by
the
> preprocessor and there's no chance of comments mucking it up.
> 
> -James "Corvidae" Williams ([EMAIL PROTECTED])
> Administrator, Wavelength Forums
(http://www.planethalflife.com/wavelength)
> Co-Leader / Coder, Underhive (http://www.underhive.com)
> 
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list
archives, please visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
> 
> 

---------------------------------------
Eight percent of life is showing up.
  -- Woody Allen _______________________________________________
To unsubscribe, edit your list preferences, or view the list archives,
please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders


_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to