|
Selection Structures
|
Previous Top Next |
|
|
| 1. | "if" EXPR "then" BLOCK |
|
| 2. | "if" EXPR "then" BLOCK "else" BLOCK |
|
| - | Example 1:
|
| - | Example 2:
|
| //
It deletes file
|
| DeleteFile(File);
|
|
|
| //
It creates a directory
|
| CreateDir ('c:\files');
|
|
|
| //
It creates a file
|
| CreateFile(File);
|
| - | Example 1:
|
|
|
| //
otherwise create file
|
| Else CreateFile(File);
|
| - | Example 2:
|
| DeleteFile(File);
|
|
|
| //
otherwise
|
| Else
|
| Begin
|
| //
It creates a directory
|
| CreateDir ('c:\files');
|
|
|
| //
It creates a file
|
| CreateFile(File);
|
| End;
|