Tcl
|
This Tcl script provides a couple of procedures for handling lists. |
The input parameters are: getFromList inputList a list of items to be searched pattern returns the value associated with this item Notes: The inputList must be list of pairs of items. For example, set mylist { { frame {2}} { startcolor {0.4 0.5 1}} { radius {5}} } # print the radius to the console puts "radius = [getFromList $mylist radius]" getComponent inputText text containing 3 values index the index of the value to be returned Example: # print the red component of a color to the console set color [getFromList $mylist startcolor] set r [getComponent $color 0] puts "red component is $r" |
© 2002- Malcolm Kesson. All rights reserved.