Embarcadero Delphi For in array


Example

A for loop iterate through items in an array

program ArrayLoop;
{$APPTYPE CONSOLE}  
const a : array[1..3] of real = ( 1.1, 2.2, 3.3 );
var f : real;
begin
  for f in a do
    WriteLn( f );    
end.

Output:

1,1
2,2
3,3