[fpc-pascal] Initialize the object (not class)

Zaher Dirkey parmaja at gmail.com
Sun Jul 18 21:01:10 CEST 2010


I have used object to make more easy, not need to create or free it,

MyObject = object
private
  FProp1: integer;
public
  Prop1: integer read FProp1 write FProp1
  procedure Proc1;
end;

used like
var
  O: MyObject;
begin
  O.Proc1;
end;

1 - The problem, i have random value in the prop1(I am not sure about it),
is that mean i must initiliaze it.
2 -  is there a method i can override it to init my properties without to
call it manualy O.init;

Thanks in advance
-- 
Zaher Dirkey
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20100718/49730b39/attachment.html>


More information about the fpc-pascal mailing list