| |
|
|
Frank Tretter | How can in a Richedit to one beliebigen Text Search. Have unfortunately yet yet nothing here above red.
use WinXP and XProfan 8.
be for each Help grateful |
|
|
| Seit 2008 endlich XProfan 10, ist einfach klasse | 03/30/07 ▲ |
|
|
|
|
Nico Madysa | How seek thou in normalen Edits? i'd simply whom Text with GetText$() read and then InStr() take. |
|
|
| |
|
|
|
Frank Abbing | NICO! ash on your master... to that Search there z.B. The Message EM_FINDTEXT. |
|
|
| |
|
|
|
Frank Tretter | |
|
|
|
| |
|
| |
|
|
|
Frank Tretter | Sorry, kenn me not yet so from. here the code CompileMarkSeparationDeclare FileName$,RichEdit&,Ende&,Suchen&,Beenden&
Declare n$,Bereich#,Gefunden&,Startsuche&,Suchtext$
Startsuche& = 0
Ende& = 0
*******************************************************************************************************************
cls
Suchen& = Control(Button,Suchen,$40000000+$10000000+$10000,420,10,200,22,%hwnd,20000,%HINSTANCE)
Beenden& = Control(Button,Ende,$40000000+$10000000+$10000,420,40,200,22,%hwnd,20001,%HINSTANCE)
RichEdit& = Create(RichEdit,%hwnd,,0,5,400,300)
RTF laden
FileName$ = LoadFile$(Als RTF öffnen,*.RTF)
RTF(LoadRTF,Richedit&,Filename$)
setfocus(Richedit&)
Tastatur und Maus abfragen
WhileNot Ende&
Case Getfocus(Beenden&) : Ende& = 1
If Getfocus(Suchen&)
n$ = Klaus--Dieser Text soll gesucht werden(Nur zum Beispiel)
Suchtext$ = GetText$(RichEdit&)--Text aus Richedit
DIM Bereich#,32000
clear Bereich#
String Bereich#,0 = Suchtext$
Gefunden& = MemPos(Bereich#,Startsuche&,n$)
Startsuche& = Gefunden&+Len(n$)
Sendmessage(Richedit&,$00B1,Gefunden&,Gefunden&+Len(n$))--Cursor setzen
setfocus(Richedit&)
Dispose Bereich#--Hatt ich vergessen
EndIf
ENDWHILE
i want in large Texten to Wörtern search. can Yes his that the sought word number of times vorkommt, therefore should one such a long time search To one The right place found has. |
|
|
| Seit 2008 endlich XProfan 10, ist einfach klasse | 03/30/07 ▲ |
|
|
|
|
Frank Abbing | this is not sonderlich heavy: CompileMarkSeparationDeclare x&
If Getfocus(Suchen&)
n$=Klaus--Dieser Text soll gesucht werden(Nur zum Beispiel)
DIM Bereich#,16
clear Bereich#
x&=-1
While 1
Long bereich#,0=x&+1
Long bereich#,4=-1
Long bereich#,8=Addr(n$)
x&=Sendmessage(Richedit&,$0438,1,bereich#)--EM_FINDTEXT (1=Flagparameter)
Case x&=-1:BREAK
Sendmessage(Richedit&,$00B1,x&,x&+Len(n$))--Cursor setzen
SetFocus(Richedit&)
Sleep 500
EndWhile
SetFocus(Richedit&)
Dispose Bereich#--Hatt ich vergessen
EndIf
with whom Flagparametern can you yet to determine, whether the Suchbegriffe exakt so voices must (small/Grossbuchstaben), whether the Suchbegriff one vollständiges word in the Text his must, etc. |
|
|
| |
|
|
|
Frank Tretter | Vielen Thanks, very the I sought have. have me very weitergeholfen, now can I on my editor weiterbasteln.
over again thanks all, gruß Fränki |
|
|
| Seit 2008 endlich XProfan 10, ist einfach klasse | 03/30/07 ▲ |
|
|
|
|
Nico Madysa |
NICO! ash on your master... to that Search there z.B. The Message EM_FINDTEXT.
likes thoroughly his, i'd nevertheless so search, I The Message now first kennen learnt have. |
|
|
| |
|
|
|
Frank Abbing | speaks nothing against it. however is these method not grossen Files anzuraten, because sometime the memory concise becomes. then are two copies zeitgleich not advisable. |
|
|
| |
|
|