This repository has been archived on 2024-12-25. You can view files and clone it, but cannot push or open issues or pull requests.
2024-03-10 20:32:51 +03:00

39 lines
867 B
ObjectPascal
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Все возможные способы инициализации поцедурной переменной
// Процедурный тип реализован через делегаты .NET, для него доступны операции +=, -=
procedure pp;
begin
writeln('Вызов обычной процедуры');
end;
type
A = class
private
x: integer;
public
constructor Create(xx: integer);
begin
x := xx;
end;
procedure pp;
begin
writeln('Вызов метода класса, значение поля равно ',x);
end;
class procedure ppstatic;
begin
writeln('Вызов классового метода класса');
end;
end;
var p: procedure;
begin
p := pp;
var a1: A := new A(5);
p += a1.pp;
p += A.ppstatic;
p;
writeln;
p -= pp;
p;
end.