seit 'ner Weile (ich glaub Delphi 2006) geht auch Folgendes:
Delphi-Quellcode:
TRec = record
p1, p2, p3, p4: TPoint;
private
function ReadP(index: integer): TPoint;
procedure WriteP(index: integer; p: TPoint);
public
property p[index: integer]: TPoint read ReadP write WriteP;
procedure ReadP3: TPoint;
end;
function TRec.ReadP(index: integer): TPoint;
begin
case index of
1: result := p1;
2: result := p2;
3: result := p3;
4: result := p4;
end;
end;
procedure TRec.WriteP(index: integer; p: TPoint);
begin
case index of
1: p1 := p;
2: p2 := p;
3: p3 := p;
4: p4 := p;
end;
end;
procedure TRec.ReadP3: TPoint;
begin
result := p3;
end;
also fast so wie man es auch von den Klassen her kennt.