if
| Syntax |
if expression statements1 else statements2
|
| Action |
Evaluates the if expression. If the result is true, executes statements1. The else clause of the if statement is optional. If it is provided, and expression evaluates to false, statements2 are executed.
|
| Examples |
if not file.exists (path) {file.new (path)}
file.setType (path, 'TEXT')}
else
This example demonstrates the use of the else clause, which enables us to take one of two possible courses of action depending on the result of a test - in this case whether we are dealing with a file or a folder. |
| See Also |
case
|