Decision Constructs
ViviFire lets you do tests for different conditions and run different statements as a result. You can do tests for true or false conditions, different values of an expression, or when code cannot continue because of unusual conditions.
If…Else
The statement If…Else
lets you do tests on one or more conditions, then run one or more statements as a result of each condition.
A short list of how you can use it follows.
- Run some statement(s) if a condition is true.
- Run some statement(s) if a condition is false.
- Run some statement(s) if a condition is true, or some other(s) if it is false.
- Do a test with a different condition if the condition before it is false.
See If…Else Statement for more information.
Select…Case
The statement Select…Case
lets you do tests with one expression and one or more values.
Then it runs one or more statements if a test is correct or incorrect.
See Select…Case Statement for more information.
Try…Catch…Finally
The statement Try…Catch…Finally
lets you run code where unusual conditions (known as exceptions) can occur in a controlled manner.
One or more statements can run because of the type of exception.
You can also specify one or more statements that must always run if an exception occurred or not.
See Try…Catch…Finally Statement for more information.