home *** CD-ROM | disk | FTP | other *** search
- case string [in] patList body patList body ...
- Match string against each of the patList arguments in
- order. If one matches, then evaluate the following
- body argument by passing it recursively to the Tcl
- interpreter, and return the result of that evaluation.
- Each patList argument consists of a single pattern or
- list of patterns. Each pattern may contain any of the
- wild-cards described under string match. If a patList
- argument is default, the corresponding body will be
- evaluated if no patList matches string. If no patList
- argument matches string and no default is given, then
- the case command returns an empty string. For example,
-
- case abc in {a b} {format 1} default {format 2} a* {format 3}
-
- will return 3,
-
- case a in {a b} {format 1} default {format 2} a* {format 3}
-
- will return 1, and
-
- case xyz {a b} {format 1} default {format 2} a* {format 3}
-
- will return 2.
-
-