POSITION:028,114
COLOUR:STANDARD
TEXT:00,When the "if" statement has an "else" option added, only one of two
TEXT:16,things will happen. If the expression portion of the "if" statement works
TEXT:16,out to be true, the statements immediately following below are executed,
TEXT:16,and the statements under the "else" line are ignored. If the expression
TEXT:16,works out to be false, it's the reverse that happens. The statements
TEXT:16,under the "if" line are ignored, but the statements under the "else"
TEXT:16,line are executed. Whatever the outcome of the expression, the first
TEXT:16,statement following "end if" is always executed once the "if" statement
TEXT:16,completes. A demo is available on this screen to show the use of "else".
TEXT:32,Using an "if-else" combination can handle situations that result in only
TEXT:16,one of two outcomes. For situations that can result in more than two
TEXT:16,outcomes, we replace "else" with "elsif".
