mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-20 07:11:43 +02:00
29 lines
395 B
ObjectPascal
29 lines
395 B
ObjectPascal
type tFoo = object
|
|
a:integer;
|
|
constructor Create;
|
|
procedure ReadA;
|
|
procedure ShowA;
|
|
end;
|
|
|
|
constructor tFoo.Create;
|
|
begin
|
|
a:=0;
|
|
end;
|
|
|
|
procedure tFoo.ReadA;
|
|
begin
|
|
write('a: '); Readln(a);
|
|
end;
|
|
|
|
procedure tFoo.ShowA;
|
|
begin
|
|
writeln('A=',a);
|
|
end;
|
|
|
|
var Foo:tFoo;
|
|
begin
|
|
Foo.Create;
|
|
Foo.ReadA; {this leaves Foo.a untouched, but it should'nt}
|
|
Foo.ShowA;
|
|
end.
|