![]() |
Wie oft kommt ein bestimmtes Wort im Memo vor?!
Hey,
hab leider noch nicht so viel ahnung und hab mir ein kleines Tool geschrieben um mir ein wenig arbeit zu ersparen... funktioniert auch eigentlich ganz prima nur um es noch ein wenig zu verbessern würde ich gern bestimmte Wörter in einem Memo zählen und mir die Anzahl ausgeben lassen... Wie mach ich das am besten? Bin für jeden Tipp oder Hinweis dankbar! Grüüße! |
Re: Wie oft kommt ein bestimmtes Wort im Memo vor?!
such mal hier unter "pos"
aja herzlich willkommen - ;) |
Re: Wie oft kommt ein bestimmtes Wort im Memo vor?!
is mir auch shcon in den sinn gekommen ;)
hatte nur noch nicht gefunden wie das ganze damit umgeht wenn ein wort öfters vorkommt... |
Re: Wie oft kommt ein bestimmtes Wort im Memo vor?!
Zitat:
|
Re: Wie oft kommt ein bestimmtes Wort im Memo vor?!
|
Re: Wie oft kommt ein bestimmtes Wort im Memo vor?!
Jupp, und wenn man mal alle Tipps zusammenlegt und nach [cl]pos posex count*[/cl] in der CodeLib sucht, dann kommt sogar Nocheiner zum Vorschein :roll:
|
Re: Wie oft kommt ein bestimmtes Wort im Memo vor?!
WOW :shock: soo viel asm :gruebel:
Ich dachte an ne einfache "WHILE posex > 0" Schleife ... |
Re: Wie oft kommt ein bestimmtes Wort im Memo vor?!
naja, der code hat mit delphi sehr wenig zu tun :)
ist wohl so eine art assembler! ne schleife geht natürlich! memofeldinhalt auf einen string speichern, im string mit while length(string) > 0 und pos nach dem wort suchen. wenn gefunden hochzählen und ganz wichtig: gefundenes wort löschen! |
Re: Wie oft kommt ein bestimmtes Wort im Memo vor?!
Zitat:
Zitat:
Zitat:
Memoinhalt gibbet schon als fertigen string ... memo1.text und warum "while length(string) > 0" und pos :gruebel: ok. .. wenn du das mit Pos machst macht das Kopieren und löschen wieder sinn :oops: Allerdings wird der string nie Length = 0 wenn du nur die gefundenen Wörter löscht ;) Ich hätte einfach (s.o.) mit while posex() gearbeitet .. bei fund des Suchstrings (result > 0) einfach inc(anzahl) und fundstelle+1 (für neuen durchlauf) gemerkt... nagut Himitsu's ASM ist bestimmt Performanter und so .. |
Re: Wie oft kommt ein bestimmtes Wort im Memo vor?!
Zitat:
muss while pos ... > 0 heißen!!! |
Alle Zeitangaben in WEZ +1. Es ist jetzt 05:22 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz