Re: D5 - Class\Collection example??



"Don @earthlink.net>" <don81846<NODAMSPAM> schreef in bericht
news:acb2h35oqr08o01fvnaa9h39tmpojtrklg@xxxxxxxxxx

Could someone please point me to, or post, a very simple code example
of a class heirarchy. Something like a person class that has a
collection of wives that each have a collection of addresses, etc.


type
Taddress = class
street : string;
etc...
end;
Tindividual = class
name : string;
sex : char;
partners : array of Tindividual;
addresses : array of Taddress;
constructor ceate;
procedure addPartner(partner : Tindividual);
end;

constructor Tindividual.create;
begin
inherited;
setLength(partners,0); // not strictly necessary
setLength(addresses,0);
end;

procedure Tindividual.addPartner(partner : Tindividual);
var m : integer;
begin
m:=high(partners)+1;
steLength(partners,m+1);
partners[m]:=partner;
// what to do about the partner of this partner ?
// It should be self, but you cannot call partner.addPartner(self)
// since it will result in an infinite loop !
end;

Tom




.



Relevant Pages

  • Re: REPAIR INSTALL
    ... partner is an old bag with spacious sagging bacon cones, ... the problem is that I don't have an "R"" repair option available on ... After about 4 hours of wanking I realised I couldn't get the string off. ... I had to look at nekkid pictures of fat wimmin before I was able to go ...
    (alt.os.windows-xp)
  • Re: REPAIR INSTALL
    ... whose partner is a boong-moll with a bald tinkleflower, ... I tied a length of string around my cock once. ... I had to look at nekkid pictures of fat wimmin before I was able ... Most women have other things to rest ones head on apart from spare tyres. ...
    (alt.os.windows-xp)
  • Re: REPAIR INSTALL
    ... whose partner is a muff-merchant with a virulent meat muffin, ... I tied a length of string around my cock once. ... I had to look at nekkid pictures of fat wimmin before I was ... Depends on what else you're doing whilst resting your head, ...
    (alt.os.windows-xp)
  • Re: REPAIR INSTALL
    ... partner is an old bag with spacious sagging bacon cones, ... I tied a length of string around my cock once. ... I had to look at nekkid pictures of fat wimmin before I was able ... considered the fat wimmin, I have a very high aversion to fat people, ...
    (alt.os.windows-xp)
  • Re: sata drive install
    ... whose partner is a drive-thru-girl with a diseased slimey slot, ... it mentions something about drives on array 1 and array 2 stripe mode ...
    (alt.os.windows-xp)