Sunday, November 10, 2013

TCL: invalid command name "else"

If you are used to traditional if-else and wrote "else" in separate line in TCL like below

if { ... } {
...
}
else {
...
}

You will get an error like me: invalid command name "else"

To get ride of this error, put the "else" and the "if" ending brackets in the same line

if { ... } {
...
} else {
...
}