[fpc-pascal]Classes/Objects/Pointers / Pointer Help
James Mills
prologic at prologitech.com
Mon Feb 10 14:04:02 CET 2003
On Mon, Feb 10, 2003 at 03:55:45PM +0100, Anton Tichawa wrote:
> 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?
Yes ok, fair enough, this much is in my knowledge of Pascal :) hehe, but
the real question is, how do you create these objects on the fly in a
program, ie: dynamic array...
I have tried using plain objects, and have failed in frustration. When
you suggested using classes, it worked right away (of course :P).
cheers
James
>
> 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
>
> ----------
> _______________________________________________
> fpc-pascal maillist - fpc-pascal at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
More information about the fpc-pascal
mailing list