H (Hybrid) Language - v0.03, by Dr. Herong Yang
Conditional "elseif" Statement
This section describes what is a conditional 'elseif' statement in H language.
A conditional "elseif" statement is a statement that follows an "if" or another "elseif" statement with a given condition and a sub-statement.
A conditional "elseif" statement will be executed only when all conditions were failed in previous "if" and "elseif" statements.
When a conditional "elseif" statement executed, the given condition is evaluated first, if the condition is satisfied, the given sub-statement is then executed.
A conditional "elseif" statement has the following syntax:
$if ...; $elseif ...; $elseif condition, sub-statement;
Examples of conditional "elseif" statements are:
$if x > 0, write("x is a positive number."); $elseif x < 0, write("x is a negative number."); $if hour < 12, write("Good morning!"); $elseif hour > 18, write("Good evening!");
Design options:
1. Use $elseif to specify "elseif" statements.
2. Use $elsif to specify "elseif" statements.
3. Use $else $if to specify "elseif" statements.
Table of Contents
►Conditional "elseif" Statement
"switch" Statement - Not Supported
"do...while" Statement - Not Supported
Inheritance - Object Attachments