INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

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!

*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.

Jobs

TCL proc and arg quartion

TCL proc and arg quartion

(OP)

I have the following tcl code.

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:

CODE

::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

CODE

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!

Resources

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