Oder ganz komfortabel mit einem Record Helper:
Delphi-Quellcode:
TDayOfWeekSetHelper = record helper for TDayOfWeekSet
function GetAsInteger: Integer;
procedure SetAsInteger(const Value: Integer);
property AsInteger: Integer read GetAsInteger write SetAsInteger;
end;
function TDayOfWeekSetHelper.GetAsInteger: Integer;
begin
Result := Byte(Self);
end;
procedure TDayOfWeekSetHelper.SetAsInteger(const Value: Integer);
begin
Byte(Self) := Value;
end;
...
IniS.WriteInteger(section, ident, aDayOfWeekSet.AsInteger);
...
exclude.AsInteger := IniS.ReadInteger(section, ident, 0);