Definirano je:
Code:
tRec1=record
fTopLeft, fTopRight, fBottomLeft, fBottomRight: TPoint;
end;
tKlas1=class
...
private
fRec = tRec1;
public
property Rec: tRec1 read fRec write fRec;
end;
tKlas2=class
...
private
fKlas1: tKlas1;
public
property Klas1: tKlas1 read fKlas1 write fKlas1;
end;
tRec1=record
fTopLeft, fTopRight, fBottomLeft, fBottomRight: TPoint;
end;
tKlas1=class
...
private
fRec = tRec1;
public
property Rec: tRec1 read fRec write fRec;
end;
tKlas2=class
...
private
fKlas1: tKlas1;
public
property Klas1: tKlas1 read fKlas1 write fKlas1;
end;
Podacima iz recorda tRec1 pristupam samo iz klase. Objekti su definirani, da ne kopiram kod... ono što javlja grešku:
Ako pokušam:
Code:
Klas1.Rec.fTopLeft := 0;
Klas1.Rec.fTopLeft := 0;
compiler javi grešku: Left side cannot be assigned to
Ako pokušam:
Code:
Klas1.fRec.fTopLeft := 0;
Klas1.fRec.fTopLeft := 0;
sve je ok.