TCL - echo
Hi,
Is there a way of writing a message to the TCL Shell window ie echo “Hello world”
or puts “Hello World“
?
This would make writing TCL scripts easier to debug!
Comments (10)
-
reporter -
Hi Brian,
The TCL Shell will execute one command at one time. The last one.I just upgraded the Script Editor to be able to Run a batch of commands added in the Script Editor tab window.
The Script Editor can be accessed from File → Scripting → New Script. -
I’ve updated the Beta repository. Have a look at the changes and see if there are any issues. Thanks!
-
reporter Something broke!!
clear
set Tree 0
if {$Tree == 1} {
puts "1 Trees"
} else {
puts "0 Trees"
}
give an error
ERROR: missing close-brace
while executing
"if {$Tree == 1} {"
1 Trees
ERROR: missing close-brace
while executing
"} else {"
0 Trees
ERROR: invalid command name "}"
while executing
"}"
While, this works
clear
set Tree 0
if {$Tree == 1} {puts "1 Trees"} else {puts "0 Trees"}
-
reporter -
I made it to evaluate each line. Unfortunately the repeated commands are disregarded otherwise (like puts”a” followed by puts “b” and so on).
I may have to revert or look if the eval() method of the TCL allow somehow repeating the commands. -
reporter Same happen even without and puts!
clear
set Tree 1
if {$Tree == 1} {
set Green Yes
} else {
set blue No
}
… sorry, just read your msg again, yes revert it for now.
Thanks, Brian.
-
Hi Brian,
I have added a new way to process repeating Tcl Commands.
I will update the Beta repo in about one hour.
Please test and tell if there are any other issues.
Thanks,
Marius -
OK, repo updated. You can test whenever you have the time.
-
- changed status to resolved
Solved in one of the latest commits to Beta branch.
- Log in to comment
Sorry but need to add more info.
puts "Hello World"
does work when typed into the TCL Shell command line.If you were to paste the below four lines in the command line as a single block, then ONLY the last only will echo
puts "Hello World 01"
puts "Hello World 02"
puts "Hello World 03"
puts "Hello World 04"
Hope that makes sense!!
Many Thanks