Autor Beitrag
Fabian W.
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Sa 23.04.05 10:12 
Hallo.
Folgender Code soll die in einem Memo aufgelisteten einträge der Reihe nach (pro Eintrag eien Zeile) überprüfen, ob sie in einem anderen Memo stehen (ebenfalls pro eintrag eine zeile). Nur macht die Schlife nicht das was ich will. Sie übersieht alle Einträge bis auf den letzten, und gibt bei ihm die Meldung aus obwohl sie in Memo3 aufgelistet ist. Wo liegt der Fehler, kennt jwmand ne bessere Methode?

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
x := 0;
y := 0;
erlaubt := false;


while x < Memo1.Lines.Count do
  begin
      while y < Memo3.Lines.Count do
      begin
      if Memo1.Lines[x] = Memo3.Lines[y] then
        begin
        erlaubt := true;
        end;
      y := y+1;
      end;

    if erlaubt = true then
    begin

    end
    else
    begin
    Form2.Zeig('Warnung','Unbekaneter eintrag',Memo1.Lines[x],0,false);
    weitermach := false;
    end;

    erlaubt := false;
    x := x+1;
    end;
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Sa 23.04.05 10:31 
du könntest dir da viel sparen, wenn du dir mal den befehl .lines.indexof() von deinem memo anschauen würdest.

_________________
In the beginning was the word.
And the word was content-type: text/plain.
Fabian W. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Sa 23.04.05 10:33 
Von dem ha ich bis jetzt nix mitbekommen. Was macht der?
bis11
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1247
Erhaltene Danke: 2

Apple Mac OSX 10.11

BeitragVerfasst: Sa 23.04.05 10:46 
Gehe mal in die Hilfe von Delphi. Dort steht alles über den Befehl drin. Denn die Hilfe von Borland Delphi ist eine der besten die ich kennen, die bei einem Programm mitgeliefert wurde.
Fabian W. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1766

Win 7
D7 PE
BeitragVerfasst: Sa 23.04.05 12:12 
Perfekt! funktioniert enwandtfrei! DANKE :D