Hi John
As the other poster has indicated the preferred multi-conditional control
structure is "switch".
In fact, the Tcl 8.3.2 "case" manpage explicitly indicates that "case" is
obsolete.
...
DESCRIPTION
Note: the case command is obsolete and is supported only for
backward compatibility. At some point in the future it may
be removed entirely. You should use the switch command
instead.
...
A note about the use of "switch", the "--" is highly recommended before the
string to be compared, in case the string containing leading "-".
E.g.
switch -glob -- $env(OS_TYPE) {
...
Regards
Hon-Chi
>Date: Wed, 10 Jan 2001 22:06:13 -0500
>From: John Mincarelli <jo...@sy...>
>Subject: Modules 3.1.0b modules with "case" statement
>Cc: mod...@En...
>
>Hi,
>
>I have been using modules for a long time and recently ran into a problem
>with the Modules 3.1.0b version of modules on Linux. When I use Modules
>2.2beta with a module file that has a case statement it seems to work fine.
>In the example below the case statement parses out a piece of the "uname"
>and sets variables accordingly.
>
>When I use 3.1.0b it seems that the module file will not work with the case
>statement unless the case is only for Linux.
>
>Has anyone else seen this behavior ?
>
>
>Sample code:
>
>case $env(OS_TYPE) {
> { "Linux.2.2*" } {
>set arch intel_i686_linux_2.2
> }
>{ "SunOS.5.*" } {
>set arch sun_sparc_solaris_5.5.1
> }
>}
> prepend-path PATH /path/$arch
>
------------------------------------------------------------
--== Sent via Deja.com ==--
http://www.deja.com/
|