Autor Beitrag
Green
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 283

Windows XP Home
Delphi 6 Enterprise
BeitragVerfasst: Fr 11.11.05 20:07 
Kann mir jemand sagen warum folgender Delhpi Code mir bei einer LEHREN TListBox immer FALSE aus gibt...?

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
function TFormMS.suchen(SList: TListBox;eintrag: string): Boolean;
var i:integer;
begin
SList.Items.LoadFromFile('users.txt');
suchen:=true;
for i:=0 To SList.Items.Count-1 do if SList.Items[i]=eintrag then
begin
  Exit;
end;
Result:=false;
end;


Danke scho mal... MfG Green
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: Fr 11.11.05 20:18 
1. Result = True;
2. Es wird kein Eintrag geprüft (keiner vorhanden);
-> kein Exit;
3. Result = False;

War das verständlich?
Wenn kein Eintrag vorhanden ist, wird auch Exit; nicht ausgeührt.

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