How to add a comment to a block in TCL

I have a code here

proc checkPrime {no} { set i 1 set count 0 while {$i < $no} { if {{$no%$i} eq 0} { incr count } if {$count eq 2} { puts "the number is prime number" return } incr i } } 

I want to put the whole procedure in one comment, I do not want every line in C #, is there any possibility, for example, in java / * .. * / with all the commented code, for example, in tcl. and I also want a single comment to be placed in some text

+7
tcl
source share
2 answers

Besides if {0} .. , which is idiomatic (and one that most tcl programmers recognize), you can also use any other construct and things you want to comment in brackets. The real obstacle to doing here is that things inside the braids are not replaced.

Here are some of my favorites. I like them because they are self-documenting:

 set COMMENTED_OUT { commented out stuff } 

and

 proc COMMENTED_OUT {} { commented out stuff... } 

I prefer to use proc because the block of commented text is really a block of code.

Note that tcl does not compile proc bodies until the first execution, so commenting using proc as cheap as set and if {0} ...

+17
source share

This question is not clear. Do you want to comment on a block of code? Well, there are two ways: prefix each line of C # to use something along

 if { 0 } { a section of "commented" code } 

If not, please rephrase this question to show us an example of what you mean.

+11
source share

All Articles