Oops, I hit "Send message" too quickly.

The only difference in the second code is:

- personrecord renamed to personclass and declared as "personclass = class"

- "newp:= personclass.Create;" added in function newperson

Of course for a clean code, you'll need to call something like "FreeAndNil( person);" or "person.free" to release properly the memory allocated.


_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to