program tforin24; {$mode objfpc} {$apptype console} uses classes; Type TDayObject = Class DayOfWeek : Integer; Constructor Create(ADayOfWeek : Integer); end; TObjectEnumerator = Class FList : TStrings; FIndex : Integer; Function GetCurrent : TDayObject; Function MoveNext: boolean; Property Current : TDayObject Read GetCurrent; end; Constructor TDayObject.Create(ADayOfWeek : Integer); begin DayOfWeek:=ADayOfWeek; end; Function TObjectEnumerator.GetCurrent : TDayObject; begin Result:=FList.Objects[Findex] as TDayObject; end; Function TObjectEnumerator.MoveNext: boolean; begin Inc(FIndex); Result:=(FIndex