1 If... then
If condition then
Statements 1;
Statements 2;
....
End if;
2. If... then... else
If condition then
Statements 1;
Statements 2;
....
Else
Statements 1;
Statements 2;
....
End if;
3. If... then... elsif
If condition1 then
Statement1;
Elsif condition2 then
Statement2;
Elsif condition3 then
Statement3;
Else
Statement4;
End if;
Four Loop
The statements between loop and end loop are executed infinitely.
Loop
Statements;
End loop;
This is obviously not feasible. You must use the exit statement to force the loop to end.
Two Methods: first,
X: = 100;
Loop
X: = x + 10;
If X> 1000 then
Exit;
End if
End loop;
Y: = X;
Second,
X: = 100;
Loop
X: = x + 10;
Exit when x> 1000;
X: = x + 10;
End loop;
Y: = X;
5 while... loop
X: = 100;
While x <= 1000 Loop
X: = x + 10;
End loop;
Y = X;
6. For... loop
For counter in [reverse] start_range... end_range Loop
Statements;
End loop;
Here, count is an implicitly declared variable, and the initial value is start_range.
7goto
When the GOTO statement is executed, the tag-marked statement is immediately transferred.