TCL - echo

Issue #303 resolved
Brian created an issue

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)

  1. Brian reporter

    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

  2. Marius Stanciu

    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.

  3. Marius Stanciu

    I’ve updated the Beta repository. Have a look at the changes and see if there are any issues. Thanks!

  4. Brian 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"}

  5. Marius Stanciu

    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.

  6. Brian 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.

  7. Marius Stanciu

    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

  8. Log in to comment