[fpc-pascal]Classes/Objects/Pointers / Pointer Help
Anton Tichawa
anton.tichawa at chello.at
Mon Feb 10 15:55:45 CET 2003
Hello, James!
Personally, I would prefer an even simpler way - but that depends on the
future development and backwards compatibility of Free Pascal. Basically, the
first step towards objects is ENCAPSULATION, which is PURE SYTNAX, i. e.
there are no constructors / destructors required. Your example, including a
procedure "main" actually using the object would then be:
***
type TmyObject = object
procedure test;
end;
procedure TmyObject.test;
begin
writeLn('test');
end;
procedure main;
var
MyObject: TmyObject;
begin
MyObject.Test;
end;
***
That's all. Next question?
HTH
Anton Tichawa.
----------
"Adas Methode war, wie sich zeigen wird, Tagträume in offenbar korrekte
Berechnungen einzuweben."
Doris Langley Moore: Ada, Countess of Lovelace (London 1977).
----------
Anton Tichawa
Volkertstrasse 19 / 20
A-1020 Wien
mobil: +43 664 52 07 907
email: anton.tichawa at chello.at
----------
More information about the fpc-pascal
mailing list