Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
26
Task/Repeat/Delphi/repeat-1.delphi
Normal file
26
Task/Repeat/Delphi/repeat-1.delphi
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
program Repeater;
|
||||
|
||||
{$APPTYPE CONSOLE}
|
||||
{$R *.res}
|
||||
|
||||
type
|
||||
TSimpleProc = procedure; // Can also define types for procedures (& functions) which
|
||||
// require params.
|
||||
|
||||
procedure Once;
|
||||
begin
|
||||
writeln('Hello World');
|
||||
end;
|
||||
|
||||
procedure Iterate(proc : TSimpleProc; Iterations : integer);
|
||||
var
|
||||
i : integer;
|
||||
begin
|
||||
for i := 1 to Iterations do
|
||||
proc;
|
||||
end;
|
||||
|
||||
begin
|
||||
Iterate(Once, 3);
|
||||
readln;
|
||||
end.
|
||||
24
Task/Repeat/Delphi/repeat-2.delphi
Normal file
24
Task/Repeat/Delphi/repeat-2.delphi
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
program Repeater;
|
||||
|
||||
{$APPTYPE CONSOLE}
|
||||
{$R *.res}
|
||||
|
||||
uses
|
||||
System.SysUtils;
|
||||
|
||||
procedure Iterate(proc: TProc; Iterations: integer);
|
||||
var
|
||||
i: integer;
|
||||
begin
|
||||
for i := 1 to Iterations do
|
||||
proc;
|
||||
end;
|
||||
|
||||
begin
|
||||
Iterate(
|
||||
procedure
|
||||
begin
|
||||
writeln('Hello World');
|
||||
end, 3);
|
||||
readln;
|
||||
end.
|
||||
Loading…
Add table
Add a link
Reference in a new issue