if IsNewMonth = true then begin foo; end else begin bar; end; function TFMain.IsNewMonth() : boolean; begin Result := false; if DayOfTheMonth(Now()) = 1 then Result := true; end;