Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Invalid Command Name

Status
Not open for further replies.

sidG

Systems Engineer
Apr 26, 2018
2
US
Hello,
I'm getting an invalid command name error in the following script running in ActiveState Wish.

The script is simply,

#!/usr/bin/wish

tk_messageBox -default "ok" -message "this works";

usermessage "but this doesn't!";

proc usermessage {themessage} {
tk_messageBox -default "ok" -message $themessage;
}

The direct tk_messageBox call works fine but executing the usermessage command produces the error, invalid command name "usermessage".

This script is so simple that I'm beside myself in trying to figure out what's wrong. I'm doing my first tcl program/script after reading about half of Nadkarni's book. Things were working fine yesterday. I have a GUI, I'm doing lots of processing and math and stuff. Then I encountered this problem so I created this short little script (above) to try to isolate things. Anyone have any idea what I'm doing wrong here? I've attached the actual tcl file that I'm loading into the Wish console. Thanks.
 
 https://files.engineering.com/getfile.aspx?folder=1ac85d3d-2366-4b27-9272-542c7d07e574&file=test.tcl
Geeeezzzzz...

Thanks Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top