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