Autor Beitrag
Biarchiv
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 688



BeitragVerfasst: Do 08.06.06 11:35 
Hallo,

ich möchte gern das bei einer TEdit geprüft wird ob das Datum gültigkeit hat.

ZB: Edit1.text "12.03.1989"

Oder währe da die TEditMask problemloser?
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Do 08.06.06 11:42 
Moin!

Versuch es mit StrToDateDef umzuwandeln, als Default nimmst du 0 und vergleichst damit; ist das Ergebnis 0, war´s kein gültiges Datum. ;)

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Do 08.06.06 11:55 
Noch besser wäre ein DatePicker.

ausblenden Delphi-Quelltext
1:
tryStrToDate( Edit1.text, d);					


erscheint mir als gutes Mittel

_________________
Markus Kinzler.
masteroffinalfantasy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 82

Win XP
Delphi 2005 Architect
BeitragVerfasst: Do 08.06.06 12:28 
kannst auch ein Maskeditfeld nehmen
alzaimar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2889
Erhaltene Danke: 13

W2000, XP
D6E, BDS2006A, DevExpress
BeitragVerfasst: Do 08.06.06 13:25 
Mit MaskEdit kann man aber auch Daten à la '45.87.98' eingeben. ...

_________________
Na denn, dann. Bis dann, denn.