Thanks Andreas,

There might be some other advantages to my example:

The order of the results in the array (a, b, c…) can easily be
modified without having to get into the logic. And, you could also
increase/decrease the amount of affecting variables (value1, value2,
etc.) without spending too much time redoing the conditionals.

Using a table as in my example might also be very helpful to know the
results depending on the values of the different variables, which
might be easier to understand than a long switch conditional.


On 1/26/06, Andreas Weber <[EMAIL PROTECTED]> wrote:
> Ok, ok I'm clearly outnumbered here - waving white flag :-)
>
> And the approach Daniel demonstraded (similar to what Martin outlined) is
> indeed very elegant and succint.
>
> When the actions to take (depending on which combination 'is the case') are
> rather complex, requiring several lines of code, imo the immediately
> readable 'string-based' switch still has its merits in terms of
> readability/managability, but I won't insist - up to Eric to pick the one
> that best matches the needs of his project.
>
> Cheers!
> --------------
> Andreas Weber
> motiondraw.com

--
Daniel Cascais
Tel: +56 (0)2  4589495
Cel: +56 (0)9  9417355
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to