2024-12-10 10:59:20 +03:00
|
|
|
|
type TFunc = function(i: integer):integer;
|
2015-05-14 22:35:07 +03:00
|
|
|
|
|
|
|
|
|
|
function f1(i : integer) : integer;
|
|
|
|
|
|
begin
|
|
|
|
|
|
Result := i;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
function f2(i : integer) : integer;
|
|
|
|
|
|
begin
|
|
|
|
|
|
Result := i;
|
|
|
|
|
|
end;
|
|
|
|
|
|
|
|
|
|
|
|
const arr : TFunc = f1;
|
|
|
|
|
|
arr2 : array[1..3] of TFunc = (f1,f2,f1);
|
|
|
|
|
|
|
|
|
|
|
|
begin
|
|
|
|
|
|
assert(arr(3)=3);
|
|
|
|
|
|
assert(arr2[2](2)=2);
|
|
|
|
|
|
end.
|