pascalabcnet/TestSuite/usesunits/use_events6.pas
Ivan Bondarev 2007fd155c #3152
2024-06-23 14:21:12 +02:00

20 lines
273 B
ObjectPascal

uses u_events6, System;
type TClass = class(I1)
event E1: Action;
procedure RaiseMethod;
begin
if E1 <> nil then
E1();
end;
end;
begin
var i := 0;
var o := new TClass;
o.E1 += () -> begin Inc(i) end;
o.RaiseMethod();
assert(i = 1);
end.