• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM Neat Commenting Trick

M

madgetr

Guest
I stumbles upon some useful behavior of multi-line comments.

Normal Usage:
PHP:
/*
Commented
*/

Not Commented
Easily Toggle Usage: Commenting out the closing comment tag allows you to quickly add a slash to the opening comment tag to help debug and without remembering where the closing tag belongs.
PHP:
/*
Commented
//*/

//*
Not Commented
//*/
Extended Toggle Usage: Inserting a /*/ works as a pivot point, splitting a comment block into two sections with the top section commented and the bottom disabled. Adding an extra / to the opening comment tag inverts the behavior, activating the top block and deactivating the bottom.
PHP:
/*
Commented
/*/
Not_Commeneted
//*/
Inverted:
PHP:
//*
Not Commented
/*/
Commeneted
//*/
 
Last edited by a moderator:
Top