home *** CD-ROM | disk | FTP | other *** search
/ Practical Programming in Tcl & Tk (4th Edition) / TCLBOOK4.BIN / pc / exsource / 6_16.tcl < prev    next >
Text File  |  2003-04-16  |  370b  |  20 lines

  1. #
  2. # Example 6-16
  3. # There are several possible return values from catch.
  4. #
  5.  
  6. switch [catch {
  7.     command1
  8.     command2
  9.     ...
  10. } result] {
  11.     0 {                          # Normal completion }
  12.     1 {                          # Error case }
  13.     2 { return $result                        ;# return from procedure}
  14.     3 { break                        ;# break out of the loop}
  15.     4 { continue                        ;# continue loop}
  16.     default {                          # User-defined error codes }
  17. }
  18.  
  19.  
  20.