[lazarus] Trying to port a Delphi graph
Marco van de Voort
marcov at stack.nl
Sun Mar 30 16:55:14 EST 2003
> >I'm not familiar with the DISPOSE keyword or function. Can someone help
> >me decipher what is supposed to be happening here?
> Dispose is the opposite of New.
> With New you can allocate dynamic variables like:
> P: PMyRecord
> if you don't need your variable anymore you should use Dispose to fee memory
> In this case Dispose(P);
> FPC in your case complains, since it doesn't know how to dispose a pointer.
> You can avoid that by casting FTrapezes[i] to the PointerType it contains
Delphi accepts it, then so should FPC. I suspect it dates from the time of early Delphi
compability where freemem always had to have a size parameter. It doesn't need that anymore
nowadays, so that would be the same for dispose?
More information about the Lazarus