currently i am in process of reconstruction of
this 3 functions...testing each step to see how exactlly work
if you have some suggestion let me known..
Sub FindNext () as long
INT loc,temp
'search next
'loc=SENDMESSAGE hsci,SCI_SEARCHNEXT,temp,GetText(fwed1)
' print "search:" + str(loc)
'if loc = 1
'loc=SENDMESSAGE hsci,SCI_GETSELECTIONEND,0,0
' print "is selected-LOC: " + str(loc)
'else
'loc=SENDMESSAGE hsci,SCI_GETSELECTIONSTART,0,0
' print "selection start-LOC: " + str(loc)
'end if
'SENDMESSAGE hsci, SCI_SETANCHOR, loc ,0
'SENDMESSAGE hsci, SCI_SETCURRENTPOS,loc,0
'SENDMESSAGE hsci, SCI_SEARCHANCHOR,0,0
'temp = SCFIND_WHOLEWORD
' print "TEMP: " + str(temp)
loc = SENDMESSAGE hsci,SCI_SEARCHNEXT, SCFIND_WHOLEWORD, GetText(fwed1)
print "SEARCH-NEXT: " + str(loc)
'---------------------------------------------
IF loc > 0
SENDMESSAGE hsci,SCI_SCROLLCARET,0,0
ELSE
Msgbox "No matches found","Search"
Return 0
END IF
'>>>>>>>>>>>
Return loc
'>>>>>>>>>>
End Sub
'------------------------------------------------
Function ReplaceOnce(RepeatStep As Long) As Long
int curloc,selected
If FindNext() = 0
Return 0
Else
selcted = SENDMESSAGE hsci,SCI_GETSELECTIONEND,0,0
print "SELECTED:" + str(selected)
curloc = : print "CURRENT LOCATION:" + str(curloc)
End if
SENDMESSAGE hsci,SCI_REPLACESEL, curloc ,GetText(fwed2)
Return 1
End Function
'>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Sub ReplaceAll
dim iResult As Long
'If FindNext() = 0 then
' Exit Function
'End If
iResult = ReplaceOnce(1)
If iResult = 0 then Exit Sub
While iResult =1
FindNext()
iResult = ReplaceOnce(1)
Wend
MsgBox " All words Replaced!","Info"
End Sub