Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


TCL proc and arg quartion

TCL proc and arg quartion

TCL proc and arg quartion


I have the following tcl code.


proc add_led_control_component { led } {
      dashboard_add ${::led_control::dash_path} label_led_${led} label leds_group
      dashboard_set_property ${::led_control::dash_path} label_led_${led} text "Led ${led}"
      dashboard_add ${::led_control::dash_path} box_led_${led} comboBox leds_group
      dashboard_set_property ${::led_control::dash_path} box_led_${led} options { "Off" "On" "Blink fast" "Blink slow"}
      dashboard_set_property ${::led_control::dash_path} box_led_${led} onChange {::led_control::toggle ${led}}

If I call the above proc with:


::led_control::add_led_control_component 1 

I get an error msg: can't read "led": no such variable while executing "::led_control::toggle ${led}".
Probably due to lack of TCL knowledge.

I don't understand why "dashboard_add ${::led_control::dash_path} label_led_${led} label leds_group" is working and why "dashboard_set_property ${::led_control::dash_path} box_led_${led} onChange {::led_control::toggle ${led}} is not.

Can some one explane this to me?

RE: TCL proc and arg quartion

Bit of a swag here, but do you need


dashboard_set_property ${::led_control::dash_path} box_led_${led} onChange ${::led_control::toggle ${led}} 
.. add a $ var ref to the last parameter? Try addding a "put 'xxx'" command inline and see if that parses out to the variable value you're after.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close