home *** CD-ROM | disk | FTP | other *** search
/ Practical Programming in Tcl & Tk (4th Edition) / TCLBOOK4.BIN / pc / exsource.old / 8_2.tcl < prev    next >
Text File  |  2003-04-15  |  245b  |  18 lines

  1. #
  2. # Example 8-2
  3. # Referencing an array indirectly.
  4. #
  5.  
  6. set name TheArray
  7. #=> TheArray
  8. set ${name}(xyz) {some value}
  9. #=> some value
  10. set x $TheArray(xyz)
  11. #=> some value
  12. set x ${name}(xyz)
  13. #=> TheArray(xyz)
  14. set x [set ${name}(xyz)]
  15. #=> some value
  16.  
  17.  
  18.