CS 3304: Comparative Languages
Control Structures
[
Course Documents
] : [
Control Structures
]
Previous
Contents
Next
Keyword Index
Ada For Loop
Syntax:
for var in [reverse] discrete_range loop ... end loop;
Design choices:
Type of the loop var is that of the discrete range; its scope is the loop body (it is implicitly declared)
The loop var does not exist outside the loop
The loop var cannot be changed in the loop, but the discrete range can; it does not affect loop control
The discrete range is evaluated just once