Seed7 
 FAQ 
 Manual 
 Screenshots 
 Examples 
 Algorithms 
 Download 
 Links 

 Examples 
 echo args 
 declare stmt 
 template 
 operator 
 file in string 
 simple clock 
 count words 
 subtype 
 Examples 
Declare a statement
 previous   up   next 

In the standard Seed7 library "seed7_05.s7i" the 'for' statement for arrays is declared as follows:

 const proc: for (inout baseType: variable) range (in arrayType: arr_obj) do
               (in proc: statements)
             end for is func
   local
     var integer: number is 0;
   begin
     for number range 1 to length(arr_obj) do
       variable := arr_obj[number];
       statements;
     end for;
   end func;

The syntax of this 'for' statement is declared as:

 $ syntax expr: .for.().range.().to.().do.().end.for is              -> 25;

Additionally everybody can overload the 'for' statement also. Because of this powerful features Seed7 does not need Iterators.


 previous   up   next