[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

6.8.1.3 Case 3: If-ElseIf-Else

Here two Else branch modules are used with the If to provide a three way switch. As before, the If checks if x is 1, and writes a message if it is. Then, an Else branch is used with condition to check if x is 2 only if the first branch fails. Finally, the third branch module is an Else with a blank condition, which will catch all remaining cases.

images/std-branch-ex1b
images/std-branch-ex3a
images/std-branch-ex2b
images/std-branch-ex3b



This document was generated on October, 28 2005 using texi2html