Task

Write a procedure which accepts as arguments another procedure and a positive integer.

The latter procedure is executed a number of times equal to the accepted integer.




$ include "seed7_05.s7i";
 
const proc: myRepeat (in integer: times, in proc: aProcedure) is func
  local
    var integer: n is 0;
  begin
    for n range 1 to times do
      aProcedure;
    end for;
  end func;
 
const proc: main is func
  begin
    myRepeat(3, writeln("Hello!"));
  end func;