| View previous topic :: View next topic |
| Author |
Message |
toralf
Joined: 31 Jan 2005 Posts: 3842 Location: Bremen, Germany
|
Posted: Mon Jan 31, 2005 11:07 am Post subject: higher priority for case structure? |
|
|
Referring to Chris list of planed improvements, I would ask for a higher priority of
| Quote: | | A simple select/switch/case structure as an alternative to a series of ""else if"" statements. This might also help with the lack of support for the OR conjunction. |
I'm working on a small project that requires a lot of checks of different cases. I used UNIX script in the past and found that the case structure helped much to improved readability of the scripts in comparison to structures like if ... elseif … elseif … fi.
What are your opinions? _________________ Ciao
toralf  |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10467
|
Posted: Mon Jan 31, 2005 1:23 pm Post subject: |
|
|
I'm not sure if it would help, but you might try using the "if var in <matchlist>" command to help with your script. For example:
if color in red,orange,yellow
{
....
}
else if color in black,silver,gray,white
{
...
}
else ; Default for all colors not mentioned above.
{
...
}
The reason I suggest this alternative is that it might be a while before the switch/case syntax gets done, because there are some higher priority items on the list. |
|
| Back to top |
|
 |
toralf
Joined: 31 Jan 2005 Posts: 3842 Location: Bremen, Germany
|
Posted: Mon Jan 31, 2005 4:19 pm Post subject: |
|
|
Thanks a lot,
That will help. _________________ Ciao
toralf  |
|
| Back to top |
|
 |
|