Autor Beitrag
hibbert
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1007

WinServer2003, Win XP, Linux
D6 Pers, D05
BeitragVerfasst: Do 15.04.04 20:51 
Hi,
wenn ich einen String in einer Listview suche, dann benutzt man ja am besten Findcaption, doch was gibt Findcaption aus, wenn ein resultat gefunden wurde?

Wenn kein resultat gefunden wurde gibt Findcaption nil aus.

thx hibbert

_________________
I kunnen väl svara endast ja eller nej
Om i viljen eller nej
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Do 15.04.04 21:28 
ja wenn die caption gefunden wurde wird das listitem zurückgegeben, dass auf die suchanfrage passt.

_________________
In the beginning was the word.
And the word was content-type: text/plain.
hibbert Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1007

WinServer2003, Win XP, Linux
D6 Pers, D05
BeitragVerfasst: Do 15.04.04 22:13 
gut danke, aber ich kann damit leider nicht viel anfangen... :oops:

wie übertrage ich denn zb. das ergebnis in eine listbox ( also die Caption)?

thx hibbert

_________________
I kunnen väl svara endast ja eller nej
Om i viljen eller nej
toms
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1099
Erhaltene Danke: 2



BeitragVerfasst: Do 15.04.04 22:23 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
var
 ListItem: TListItem;
begin
  ListItem := FindCaption(0,'irgendwas',True, True, True);
  if ListItem <> nil then
    ListBox1.Items.Add(ListItem.Caption);
end;
hibbert Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1007

WinServer2003, Win XP, Linux
D6 Pers, D05
BeitragVerfasst: Do 15.04.04 23:57 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
var 
 ListItem: TListItem; 
begin 
  ListItem :=Listview1.FindCaption(0,'irgendwas',True, True, True); 
  if ListItem <> nil then 
    ListBox1.Items.Add(ListItem.Caption); 
end;

musste ich noch korrigieren, aber funzt fast so wie ich das will.

Wenn ich Inclusive auf false setze, dann wird ja der Wert angezeigt, der den gesuchten String enthält, aber nicht der String ist, der gesucht ist.

zB.
gesucht: mauer

mauer
mauerblümchen
klagemauer
wecker

Inclusive = false --> mauerblümchen
Inclusive = true --> mauer

Nun möchte ich aber gerne alle Strings erhalten, die den String mauer enthalten.
Gibt es da noch ne Möglichkeit...?

thx hibbert

_________________
I kunnen väl svara endast ja eller nej
Om i viljen eller nej
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Fr 16.04.04 10:51 
geh alle items des listviews manuell in einer for schleife durch und schau selber nach, ob die caption passt.

_________________
In the beginning was the word.
And the word was content-type: text/plain.
hibbert Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1007

WinServer2003, Win XP, Linux
D6 Pers, D05
BeitragVerfasst: Fr 16.04.04 14:26 
matze hat folgendes geschrieben:
geh alle items des listviews manuell in einer for schleife durch und schau selber nach, ob die caption passt.

also muss ich doch den umstänlichen weg gehen, ich dachte, dass es da noch einen einfacheren Weg mit Findcaption gibt.

aber dann mache ich das halt so.

thx für deine Hilfe.

Hibbert

_________________
I kunnen väl svara endast ja eller nej
Om i viljen eller nej