Super-Easy Code Block Toggling





5.00/5 (1 vote)
This nice trick extends into://*/block 1/*/block 2; // commented out/*/block 3;/*/block 4; // commented out//*/and removing the first slash gives inverted alternation:/*/block 1; // commented out/*/block 2;/*/block 3; // commented out/*/block...
This nice trick extends into:
//*/
block 1
/*/
block 2; // commented out
/*/
block 3;
/*/
block 4; // commented out
//*/
and removing the first slash gives inverted alternation:
/*/
block 1; // commented out
/*/
block 2;
/*/
block 3; // commented out
/*/
block 4;
//*/
This enables you to alternate between odd and even sequential blocks :). It will extend to infinite count of blocks! Even more curious but sometimes usefull nonetheless, alternation can be switched wherever you like:
/*/
block 1; // commented out
/*/
block 2;
/*/
block 3; // commented out
/*/
block 4;
/*/
block 5; // commented out
/*/
block 6;
//*/
can be switched into:
/*/
block 1; // commented out
/*/
block 2;
/*/
block 3; // commented out
/*/
block 4;
//*/
block 5;
/*/
block 6; // commented out
//*/
:D ILa