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

  1. #
  2. # Example 8-4
  3. # ArrayInvert inverts an array.
  4. #
  5.  
  6. proc ArrayInvert {arrName inverseName {pattern *}} {
  7.     upvar $arrName array $inverseName inverse
  8.     foreach {index value} [array get array $pattern] {
  9.         set inverse($value) $index
  10.     }
  11. }
  12.  
  13.  
  14.