Einzelnen Beitrag anzeigen

Benutzerbild von himitsu
himitsu

Registriert seit: 11. Okt 2003
Ort: Elbflorenz
43.336 Beiträge
 
Delphi 12 Athens
 
#3

Re: Überprüfen ob String in ListBox vorhanden

  Alt 28. Aug 2004, 21:17
Also sollte
Delphi-Quellcode:
if (Listbox1.Items.Strings[Listbox1.Items.IndexOf(appexe)]) > -1 then
        ...
ausreichen, ausserdem ist doch
        Listbox1.Items.Strings[Listbox1.Items.IndexOf(appexe)]) = appexe , da ja "Listbox1.Items.IndexOf(appexe)" die Position von "appexe" und demnach "Listbox1.Items.Strings[Die_Position_von_appexe)])" wiederum "appexe" zurückgibt.

Also kommt es somit auf folgendes raus:
Delphi-Quellcode:
if (Listbox1.Items.Strings[Listbox1.Items.IndexOf(appexe)]) > -1 then
        KillProcess(GetProcessID(appexe));
Garbage Collector ... Delphianer erzeugen keinen Müll, also brauchen sie auch keinen Müllsucher.
my Delphi wish list : BugReports/FeatureRequests
  Mit Zitat antworten Zitat