Autor Beitrag
k.kuh
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 21

Win XP
Delphi 6
BeitragVerfasst: So 23.07.06 20:14 
hi leute!
ich habe ein Datum im format yymmdd, genau wie geschrieben, ohne platzhalter. ich möchte nun pruefen, ob es dieses Datum gibt, also nicht das es einen 43. Monat oder den 30. Februar enthaelt. Gibt es dafuer eine Funktion, oder muss ich mir die mühe machen und eine basteln?
vielen dank schoneinmal im vorraus.
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: So 23.07.06 20:19 
Du könntest den String Parsen und in seine Einzelteile zerlegen, diese kannst du dann in ein Datum wandeln oder selber auf Richtigkeit prüfen.

_________________
Markus Kinzler.
k.kuh Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 21

Win XP
Delphi 6
BeitragVerfasst: So 23.07.06 20:21 
Das meinte ich mit "selber basteln", ich wollte meinem code nur einfach die 12 ifs ersparen, wenn es geht *Gg*
danke trotzdem!!!
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: So 23.07.06 20:22 
Wenn du den string zerlegst und in ein TDate konvertierst, brauchst du die Ifs nicht.

_________________
Markus Kinzler.
k.kuh Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 21

Win XP
Delphi 6
BeitragVerfasst: So 23.07.06 20:34 
Da ist was dran! Gute idee. Danke!
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: So 23.07.06 20:40 
Am Besten nimmst du hierzu TryEncodeDate, so wird keine Exception ausgelöst.

_________________
Markus Kinzler.