Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

commenting large block of code

Status
Not open for further replies.

bvdang

Programmer
Aug 15, 2002
4
US
Is there a way to comment a large block of code in tcl?

In c/c++, I could use:

#if 0
.
.
.
#endif
 
In Tcl you can use:
if 0 {
...
}

Braces must be paired.

Good luck

ulis
 
In Tcl comments end at the end of the line. Point.
Code:
# This is a comment ending at the end of the line
You can split a line by introducing a \ just before the newline (no trailing space):
Code:
# This is a comment ending at the end of the line
For Tcl this is one line only.

So you can do
Code:
# this is a simili multilines comment

But the usual way remains:
Code:
if 0 {
  this is
  a simili
  multilines
  comment
}

ulis
 
does not:

if 0 {
comment
}

still process machine instructions when compiled, whereas:

#~comment

does not?

I think the same could be said in C for:

#if 0
comment
#endif

this being pre-processor commands, and therefore are not compiled into the exe.

Unfortunately I do not know the nuances of the TCL runtime compile so as to know what does wind up in machine instructions.

Thanks for your help.
 
In:
Code:
if 0 {
some stuff
}
Tcl search for matching braces to find the end of the
Code:
if
.
But never eval the body.

So you can put unbalanced brackets or quotes at your will.
But unbalanced braces break.

ulis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top