Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2008-02

Properties in records not supported ! :(

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Skybuck Flying

Hello,

Delphi 2007 has another pretty handy new feature:

"Properties in records".

For example it's even possible to have index properties.

Some that I could write code using the record like:

myRecord.SomeField[SomeIndex] := 12345;

then the property methods can place the value 12345 anywhere inside the record or even in another record via pointer fields inside the current record where I would like it to be depending on possibly/maybe some other fields of the record.

For example

procedure TMyRecord.SetValue( Index : integer; Value : integer );
begin
    if LargePenis then
    begin
        Pinteger( longword(DildoPtr) + Index )^ := Value;
    end else
    begin
        LittlePenis^ := Value;
    end;
end;

Anything goes.

Bye,
Skybuck.