Re: Invalid command name ""
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: Invalid command name ""

From: Ahran <adunsmoor@gmail.com>
Date: Fri Jul 29 2005 - 22:36:29 CEST

Square brackets tell tcl to do an evaluation in line and substitute the
results in place. Tcl evaluates each command in 2 steps so the first
step executes what's inside the square brackets and the second step
fails because it expects a valid tcl command and instead finds "" (the
result of the first command).

You'd typically use square brackets when you'd want to capture the
result of a command and do something with it later on or in and if
statement (like you see in your example) to test the results of a
command.

    set result [transform_line $click_line]
    if { $result != "" } {
        puts "I didn't expect anything but instead I got \"$result\""
    }

The Tcl man page has a decent description of this.
http://www.tcl.tk/man/tcl8.4/TclCmd/Tcl.htm#M6
http://www.tcl.tk/man/tcl8.4/TclCmd/Tcl.htm#M10

-Ahran
Received on Thu Sep 29 14:28:00 2005