Switch versus if/then/else ( was: Main menu puzzle, Klaus)

Rob Cozens rcozens at pon.net
Sun Feb 19 11:07:26 EST 2006


Judy, et al:

> Yes, but do you think in these terms in day-to-day life?
>
> IF I have the paycheck in-hand THEN
>   it will clear the bank in 2 days
>   I can write the rent check tomorrow and it will clear at the same 
> time
> END IF
>

I will grant you:

(a) As one who has used case statements for years, I may not appreciate 
the learning curve for non-programmers, and

(b) Where ifs and switches can be used interchangeably,  the choice is 
basically one of preference.

Note the "Where" in item (b).  Switches and ifs are not interchangeable 
in all syntax.  Your full example of ifs and nested ifs is _not_ an 
example of syntax that lends itself to switches, and thus is not (IMFO) 
pertinent to this discussion.

Rob Cozens
CCW, Serendipity Software Company

"And I, which was two fooles, do so grow three;
Who are a little wise, the best fooles bee."

from "The Triple Foole" by John Donne (1572-1631)




More information about the use-livecode mailing list