Autor Beitrag
delphineuling
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 113

XP
wat dat
BeitragVerfasst: So 19.03.06 22:22 
ich will überprüfen ob edit dem hh:mm:ss format enspricht wenn das nicht so ist soll er ne nachricht zeigen
hab schon mal einen vorschlag nur was muss hinter das gleich?

ausblenden Delphi-Quelltext
1:
else if (not(edit5.Text={was kommt hier rein?} ) then showmessage ('  ')					
Grenzgaenger
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: So 19.03.06 22:32 
die übliche notation tipp ich mal...

ausblenden Delphi-Quelltext
1:
if edit.text = '00:02:00' then					


oder mal einen einfachen tipp. schau mal drauf, was du in das feld eingibst und was du für richtig und was für falsch hälst.
delphineuling Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 113

XP
wat dat
BeitragVerfasst: So 19.03.06 22:59 
wen das so einfach wäre der wert ändert sich doch immer also sieht so aus
00:00:00 und für die ersten nullen ist dieser bereich 0-12 für die zweiten 0-60 und die dritten 1-60
Kroni
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 720

Win 98, Win ME, Win2k, Win XP
D3 Pro
BeitragVerfasst: So 19.03.06 23:06 
Da könntest du doch, wenn der String diesen Format haben sollte 00:00:00 prüfen:
Ist an position 3 und 6 ein :
und sind die Zeichen davor, dahinter und dazwischen Zahlen? ;)
Coder
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1383
Erhaltene Danke: 1

WinXP
D2005 PE
BeitragVerfasst: So 19.03.06 23:10 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
  if (edit5.Text[3] <> ':') or
     (edit5.Text[6] <> ':') or
     (StrToInt(copy(edit5.Text,1,2)) < 0) or
     (StrToInt(copy(edit5.Text,1,2)) > 12) or
     (StrToInt(copy(edit5.Text,4,2)) < 0) or
     (StrToInt(copy(edit5.Text,4,2)) > 60) or
     (StrToInt(copy(edit5.Text,7,2)) < 0) or
     (StrToInt(copy(edit5.Text,7,2)) > 60) then
     showmessage ('stimmt nicht');


So?
delphineuling Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 113

XP
wat dat
BeitragVerfasst: Mo 20.03.06 00:12 
das von coder ist auch gut aber habs jetzt einfach mit drei edit feldern gelöst sieht auch nett aus
danke für eure mühen
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Mo 20.03.06 07:48 
Warum nutzt Du nicht ganz einfach ein MaskEdit ?
delphineuling Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 113

XP
wat dat
BeitragVerfasst: Mo 20.03.06 11:27 
weil ich keine ahnung hab wie das funktioniert hab das noch nie benutzt aber so wie jetzt ist das auch ok
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mo 20.03.06 11:30 
Für dein Problem wurde in der DP mehere Lösung gwboten.

_________________
Markus Kinzler.