Original date:2018-01-07 11:45:32 Edited by: Ekhnat0n Subject: Re: SWITCH question

I stand corrected by the facts about the switch-method because I assumed it was an intricate kind of error-handler, whereas it is in fact just a neater way to program nested if..elsif....else...endif constructions, yielding TRUE or FALSE, and reacting to the result of that test.

This, however explains both its erratic behaviour and the fact that there are 2 different values returned. If I take the highest and call that TRUE (it might be the pointer to TRUE as well!) automagically the lower one will be (the maybe pointer to) FALSE. But because it made you end up in the constant-table it is ofc a pointer. Having been too long `off scene` I assumed it still was Eu and not OE, that's why I pointed at RC and not at Derek as its creator.

So the correct use of switch is: Switch (a) (x) (y) (z) default endswitch

BUT NEVER Switch (a) .... case (a) or any condition containing (a) again because (a) as been checked by SWITCH already and will therefore inevitably send a TRUE, followed by the test-result of the next condition.

Not Categorized, Please Help


Quick Links

User menu

Not signed in.

Misc Menu