HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- TK/TCL HELP
Operating System - Linux
1828479
Members
2790
Online
109978
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-07-2007 03:50 AM
03-07-2007 03:50 AM
TK/TCL HELP
can someone tell my why the puts is not reflecting the variable?
CUT -->
set fp [open "host2"]
while {-1 != [gets $fp line]} {
button .a${line} -text "${line} " -width 20 -command {
puts $line
}
pack .a${line}
}
CUT -->
set fp [open "host2"]
while {-1 != [gets $fp line]} {
button .a${line} -text "${line} " -width 20 -command {
puts $line
}
pack .a${line}
}
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2007 07:27 AM
03-08-2007 07:27 AM
Re: TK/TCL HELP
The {} braces around the command prevent $line from being evaluated until the button is pressed. By that time it has a null value in the context that it is evaluated in.
You can use
-command "puts $line"
if the $line value is always one word.
You can use
-command [list puts $line]
to handle lines that are multiple words. (But it looks like the rest of your example depends on having $line always be one word.)
The quoting issues with -command are covered in depth in the "Quoting hell" topic at http://wiki.tcl.tk/1726
You can use
-command "puts $line"
if the $line value is always one word.
You can use
-command [list puts $line]
to handle lines that are multiple words. (But it looks like the rest of your example depends on having $line always be one word.)
The quoting issues with -command are covered in depth in the "Quoting hell" topic at http://wiki.tcl.tk/1726
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP