Autor Beitrag
technotoolz
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 47

Win98;Win2k;WinXP
D7 Ente
BeitragVerfasst: Mo 19.04.04 11:22 
Habe zwei Listboxen ein EditFeld und ein MaskEditFeld.
LB1 mit den Usernamen und LB2 mit nummern.
In Edit1 gebe ich den Namen ein z.b: Horst.Mayer
Dieser Wert wird in LB1 rausgesucht und anschließend wird der Wert mit dem gleichen Index aus LB2 zugeordnet.
Bei dem Index 0 klappt es, nur dadrüber wird mir als pw nichts mehr angezeigt. WHY???


ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
begin
  listbox2.itemindex:=listbox1.Items.IndexOf(edit1.Text);
  pass:= (listbox2.Items[listbox2.itemindex]) ;
  showmessage(pass);
  for count2 := 1 to Length(maskedit1.Text) do
    begin
      pw := pw + IntToStr(Ord(maskEdit1.Text[count2]));
    end;
    showmessage(pw);
end;


Für alle möglichen Antworten schonmal danke.
technotoolz Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 47

Win98;Win2k;WinXP
D7 Ente
BeitragVerfasst: Mo 19.04.04 11:24 
P.S.: In beiden Listboxes sind definitiv Werte. bis zum Index 3.
Segelflieger
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 124

WinXP Pro
D7 Prof
BeitragVerfasst: Mo 19.04.04 12:03 
Bei mir funktionierts! Zumindest wird der Variablen pass der richtige Wert zugeordnet. Der Rest sieht auch richtig aus. Wo genau tritt denn welcher Fehler auf?

_________________
Früher hatten die Menschen Angst vor der Zukunft. Heute muss die Zukunft Angst vor den Menschen haben.
technotoolz Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 47

Win98;Win2k;WinXP
D7 Ente
BeitragVerfasst: Mo 19.04.04 12:13 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
begin
status:= false;
pw:='';
listbox1.Items.LoadFromFile('c:\Programme\SUSSPY\Data\Users2.sus');
listbox2.Items.LoadFromFile('c:\Programme\SUSSPY\Data\LOG.sus');
if listbox1.Items.IndexOf(edit1.Text) > -1 then
begin
  listbox2.itemindex:=listbox1.Items.IndexOf(edit1.Text);
  pass:= (listbox2.Items[listbox2.itemindex]) ; <span style="font-style: italic"><span style="font-weight: bold">//irgendwo hier muss der Fehler liegen</span></span>
  showmessage(pass);
  for count2 := 1 to Length(maskedit1.Text) do
    begin
      pw := pw + IntToStr(Ord(maskEdit1.Text[count2]));
    end;
 
showmessage(pw);
 
end,


Das Programm gibt mir keinen Wert aus, der Index wird aber von LB1 ordentlich übernommen.
Ich hab absolut keinen Plan was der Fehler ist.
technotoolz Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 47

Win98;Win2k;WinXP
D7 Ente
BeitragVerfasst: Mo 19.04.04 13:02 
Ich habs geschafft.

Nochmal Danke
Segelflieger
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 124

WinXP Pro
D7 Prof
BeitragVerfasst: Mo 19.04.04 13:13 
du meinst, bei shwomessage(pw) bekommst du eine leere meldung? steht überhaupt etwas in deinem maskedit?

_________________
Früher hatten die Menschen Angst vor der Zukunft. Heute muss die Zukunft Angst vor den Menschen haben.
technotoolz Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 47

Win98;Win2k;WinXP
D7 Ente
BeitragVerfasst: Mo 19.04.04 13:22 
Die Textdatei war kaputt. Habe den Fehler dann gefunden.
In der Listbox war eine Leerzeile, dann kanns auch nicht klappen! :wink:
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Mo 19.04.04 13:28 
Hier hättest Du auch weiter fragen können. Bitte höre auf, ständig neue Threads zum selben Problem zu eröffnen!

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
technotoolz Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 47

Win98;Win2k;WinXP
D7 Ente
BeitragVerfasst: Mo 19.04.04 14:12 
Wie schon gesagt: Kommt nicht mehr vor, aber Fehler die ich vor deinem Kommentar gemacht habe kann ich leider nicht mehr rückgängig machen.