Main Content

Comments in Tcl

Archive - Originally posted on "The Horse's Mouth" - 2005-06-16 23:15:15 - Graham Ellis

It's always a good idea to comment your programs. OK - I know you know that, but I find it's always a good idea to remind people too!

In Tcl, you add a comment starting with a # character and really what you're adding is a "do nothing" command .... in other words, the # must appear where a command would normally start (at the
beginning of a line, after a ; or after a { ) and the command will be terminated at the end of the line, but can be continued on to another line with a \

# comment \
puts hello
puts world

will just print out "world"! .....