Tutorial by Examples

Comments in Tcl are best thought of as another command. A comment consists of a # followed by any number of characters up to the next newline. A comment can appear wherever a command can be placed. # this is a valid comment proc hello { } { # the next comment needs the ; before it to indicat...
Due to the way the Tcl language parser works, braces in the code must be properly matched. This includes the braces in comments. proc hw {} { # this { code will fail puts {hello world} } A missing close-brace: possible unbalanced brace in comment error will be thrown. proc hw {} { ...
In the Tcl language in many cases, no special quoting is needed. These are valid strings: abc123 4.56e10 my^variable-for.my%use The Tcl language splits words on whitespace, so any literals or strings with whitespace should be quoted. There are two ways to quote strings. With braces and with...

Page 1 of 1