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.




' FB 1.05.0 Win64
 
Sub proc()
  Print " proc called"
End Sub
 
Sub repeat(s As Sub, n As UInteger)
  For i As Integer = 1 To n
    Print Using "##"; i;
    s()
  Next
End Sub
 
repeat(@proc, 5)
Print
Print "Press any key to quit"
Sleep