Autor Beitrag
Tchiboo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 35

Win XP Home, Mac OS

BeitragVerfasst: Fr 17.03.06 14:54 
he leute...

wie kann ich in einem edtifeld oder richeditbox abfragen ob irgendeintext drin steht...?

hab davon 4 stück und wenn in einer oder halt in allen was drin steht dann soll er eine showmessage bringen! Hab das erst mit if (ed1.text ='') or (ed2.text='') ... then showmessage('Hallo');

Das ist ja ebr logisch falsch... ich muss quasi alle abfragen, ob da text drin steht! Aberr ich wei nicht wie man das macht!

Wäre nett wenn das jemand posten könnte!

Danke
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Fr 17.03.06 15:12 
Dein Pseudocode sieht richtig aus.
Miri
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 657


Delphi 3 Prof., Delphi 2005 PE
BeitragVerfasst: Fr 17.03.06 15:18 
ich versteh dich nicht richtig...

willst du die message ausgeben wenn
1. in allen etwas drinsteht,
2. in nur einem was drinsteht,
3. entweder in einem speziellen oder in allen was drinsteht,
4. ...
5. hä?

*g*
Tchiboo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 35

Win XP Home, Mac OS

BeitragVerfasst: Fr 17.03.06 15:28 
die soll ausgegeben werden wenn entweder in einem, zwei, drei oder halt in allen was drin steht... ich will halt daraufhin eine speicherabfrage machen... und wenn ich das so mach wie zu begin... dann muss erst alles befüllt sein, um den speicherdialog bzw. showmessage zu öffnen!
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Fr 17.03.06 15:42 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.Button1Click(Sender: TObject);
begin
  if (Length(Edit1.Text) > 0) and(Length(Edit2.Text) > 0) and(Length(Edit3.Text) > 0) and(Length(Edit4.Text) > 0)then Showmessage('Steht überall was drin !')
  else Showmessage('Mindestens ein Eintrag fehlt !');
end;
Miri
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 657


Delphi 3 Prof., Delphi 2005 PE
BeitragVerfasst: Fr 17.03.06 16:11 
Wenn in mindestens einem was drin sein soll, dann muss es doch OR sein... Nur, wenn wirklich in allen was drinstehen soll, dann muss es AND sein...

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.Button1Click(Sender: TObject);
begin
  if (Length(Edit1.Text) > 0) or (Length(Edit2.Text) > 0) or (Length(Edit3.Text) > 0) or (Length(Edit4.Text) > 0)then Showmessage('Steht überall was drin !')
  else Showmessage('Mindestens ein Eintrag fehlt !');
end;
Tchiboo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 35

Win XP Home, Mac OS

BeitragVerfasst: Fr 17.03.06 19:42 
DANKE!

Ich wusste das nicht mit dem "length"! Obwohl es eigentlich logisch ist :(

Also nochmal danke @ all!

P.S. "or" ist richtig! :) Trotzdem thx Blackheart666 :)

Jörgi
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Fr 17.03.06 23:47 
Steht überall was drin, wäre mit or nicht richtig.
Aber das war doch nur ein Bsp.... das Ihr das immer so genau nehmen müsst... :D
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Sa 18.03.06 14:40 
Könnte man jetzt noch elegent mit einer Schleife und Suche in der Entwickler-Ecke FINDCOMPONENT() lösen.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)