Autor Beitrag
HouseGemacht
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18
Erhaltene Danke: 1

Win XP, Win7 Ultimate, Linux

BeitragVerfasst: Mi 10.11.10 14:28 
Hallo Forengemeinde,
Ich habe mal eine Frage: Wie kann ich eine Programm verwirklichen dass mir anzeigt wie oft das gesuchte wWrt im Text ist?

Beispiel

Text: Hallo Hallo Hallo Tschüß

Suchwort: Hallo

Ergebnis: 3

Danke im Voraus,
HouseGemacht

_________________
Sag niemals nie den nie kommt nie!
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8548
Erhaltene Danke: 477

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Mi 10.11.10 14:29 
Das geht mit Pos und PosEx in einer Schleife.

_________________
We are, we were and will not be.

Für diesen Beitrag haben gedankt: HouseGemacht
HouseGemacht Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18
Erhaltene Danke: 1

Win XP, Win7 Ultimate, Linux

BeitragVerfasst: Mi 10.11.10 14:31 
Sry aber was bewirkt den PosEx?

_________________
Sag niemals nie den nie kommt nie!
Niko S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 566
Erhaltene Danke: 10

Win 7, Ubuntu
Lazarus, Turbo Delphi, Delphu 7 PE
BeitragVerfasst: Mi 10.11.10 14:32 
PosEx hat einen Weiteren Parameter, der dazu dient, von einer bestimmten Stelle aus weiter zu suchen.

Für diesen Beitrag haben gedankt: HouseGemacht
HouseGemacht Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18
Erhaltene Danke: 1

Win XP, Win7 Ultimate, Linux

BeitragVerfasst: Mi 10.11.10 14:39 
Und wie sage ich ihm, von wo er anfangen soll?

_________________
Sag niemals nie den nie kommt nie!
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8548
Erhaltene Danke: 477

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Mi 10.11.10 14:43 
Indem du den passenden Parameter in der Funktion PosEx (iirc der dritte) auf den gewünschten Wert setzt?

_________________
We are, we were and will not be.
MaxWurzel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 77
Erhaltene Danke: 10



BeitragVerfasst: Mi 10.11.10 14:43 
ausblenden Delphi-Quelltext
1:
posex('Hallo', Text, 1);					

oder
ausblenden Delphi-Quelltext
1:
pos('Hallo', Text);					
Nersgatt
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1581
Erhaltene Danke: 279


Delphi 10 Seattle Prof.
BeitragVerfasst: Mi 10.11.10 14:44 
Ich denke, Du solltest Dich hier mal etwas einlesen:
www.delphi-treff.de/...htigsten-funktionen/

_________________
Gruß, Jens
Zuerst ignorieren sie dich, dann lachen sie über dich, dann bekämpfen sie dich und dann gewinnst du. (Mahatma Gandhi)
HouseGemacht Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18
Erhaltene Danke: 1

Win XP, Win7 Ultimate, Linux

BeitragVerfasst: Mi 10.11.10 14:47 
Kanns sein das Delphi7 das nicht unterstützt?

_________________
Sag niemals nie den nie kommt nie!
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8548
Erhaltene Danke: 477

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Mi 10.11.10 14:51 
Doch, das geht auch in Delphi7. Evtl. musst du eine weitere Unit einbinden - schau mal in der Hilfe nach, welche das ist. Könnte StrUtils sein, ganz sicher bin ich da aber nicht.

_________________
We are, we were and will not be.
Dude566
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1592
Erhaltene Danke: 79

W8, W7 (Chrome, FF, IE)
Delphi XE2 Pro, Eclipse Juno, VS2012
BeitragVerfasst: Mi 10.11.10 19:04 
delphi.about.com/lib...y/rtl/blrtlPosEx.htm

Da steht auch welche Unit benötigt wird.

_________________
Es gibt 10 Gruppen von Menschen: diejenigen, die das Binärsystem verstehen, und die anderen.