--- In [email protected], Robert Ryan <[EMAIL PROTECTED]> wrote:
>
> I have wondered if it was possible to have a case statement
> with more than 4 or 5 items and change it into a for loop.
> So, I see that it is possible, although it does take some
> understanding
>   thanks
>   bob ryan
<snip>

Robert,

in general it is always possible to avoid "switch" statements
altogether and use "if...else" chains instead. However, in many cases
a "switch" will make the code clearer and will make the program flow
more obvious to understand.
It's in most cases a matter of taste. At least for me. As mentioned,
there are enough cases when a "switch" simply doesn't work; in those
cases you will have to use "if... else if..." chains.

Regards,
Nico

Reply via email to