Hi,
I'm a novice with tcl, so I'm having trouble with using a variable to
labl_set_color index r g b
eg,
set color "255 255 255" labl_set_color 0 $color
gives error:
Wrong # args: labl_set_color index r g b
How is this done?
Thanks, Darren
Just do:
labl_set_color 0 255 255 255
Tcl is very specific about what it considers lists. When you do:
set color "255 255 255"
You're actually setting 'color' to a list containing three elements. When you pass that list to 'labl_set_color' it only counts as one argument.
On Wed, Apr 05, 2006 at 05:31:46PM -0700, Darren Weber wrote:
I'm a novice with tcl, so I'm having trouble with using a variable to
labl_set_color index r g b
eg,
set color "255 255 255" labl_set_color 0 $color
gives error:
Wrong # args: labl_set_color index r g b
How is this done?
To enable variables in my script, I resorted to something like this:
set r 1 set g 2 set b 3
array set labl_color [list $r 254 $g 204 $b 92]
labl_set_color $labelN $labl_color($r) $labl_color($g) $labl_color($b)
Thanks, Darren
Kevin Teich wrote:
Just do:
labl_set_color 0 255 255 255
Tcl is very specific about what it considers lists. When you do:
set color "255 255 255"
You're actually setting 'color' to a list containing three elements. When you pass that list to 'labl_set_color' it only counts as one argument.
On Wed, Apr 05, 2006 at 05:31:46PM -0700, Darren Weber wrote:
I'm a novice with tcl, so I'm having trouble with using a variable to
labl_set_color index r g b
eg,
set color "255 255 255" labl_set_color 0 $color
gives error:
Wrong # args: labl_set_color index r g b
How is this done?
freesurfer@nmr.mgh.harvard.edu