![]() |
Re: Datum mit Datum austauschen
Hallo,
hier noch eine Denkhilfe:
Delphi-Quellcode:
Ich habe so getestet:
function FindDate(const text: string; var position: Integer): Boolean;
var iOffs, iPos: Integer; dt: TDateTime; begin iOffs := Pred(Pos(DateSeparator, ShortDateFormat)); while position > 0 do begin position := {StrUtils.}PosEx(DateSeparator, text, position); if position = 0 then Break else iPos := position - iOffs; if TryStrToDate(Copy(text, iPos, Length(ShortDateFormat)), dt) then Break else position := Succ(position) end; Result := position > 0; position := iPos; end;
Delphi-Quellcode:
Grüße vom marabu
procedure TDemoForm.ButtonClick(Sender: TObject);
var i, iPos: Integer; begin with Memo do for i := 0 to Pred(Lines.Count) do begin iPos := 1; if FindDate(Lines[i], iPos) then Lines[i] := {StrUtils.}StuffString(Lines[i], iPos, Length(ShortDateFormat), DateToStr(Now)); end; end; |
Re: Datum mit Datum austauschen
DANKE, DANKE, DANKE!!!
Freundliche Grüße Aaron |
Alle Zeitangaben in WEZ +1. Es ist jetzt 06:19 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz