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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

List part of command

Status
Not open for further replies.

Breadcrust

Programmer
Oct 27, 2003
42
0
0
AU
i am trying to use a list as part of a command, eg:

set list "-command exit"
button .exit $list

but tcl interpets this as a single arugument. ive tryed using split but still no help, how can i get tcl to interpet the list as multiple arguments???

[tt]
Breadcrust (aka J@red)

Web - E-mail - net-head@softhome.net
Linux Reg. Number - 307180 ([/tt]
 
The quick and dirty answer:

[tt]eval button .exit $list[/tt]

The eval command concatenates all of its arguments, exactly like the Tcl concat command, and then executes the result. But be aware that there are dangers lurking in eval for the uncautious. Check out my response in thread287-727277, "exec can't find files," where I explain eval a bit more, and provide some very useful links for avoiding some of the traps and pitfalls of eval.

- Ken Jones, President, ken@avia-training.com
Avia Training and Consulting, 866-TCL-HELP (866-825-4357) US Toll free
415-643-8692 Voice
415-643-8697 Fax
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top