good evening, have tried and built this little script and if you like it to search for a word, you can use it... theme: stringmanipulation, my 5 cent for today...
[code=thinbasic]'-- lionhearts testscript for searching a word, part one, 11.april.2009
uses "console", "UI"
dim scoreahit as integer
dim searchposition as integer
dim textinfo as string
dim searchword as string
console_writeline ("-- to score a hit example, simple version --")
printl
textinfo = "superman batman hulk, spiderman superman batgirl, x-men superman robin, wolverine asterix obelix, superman incredible hulk mywoman"
searchword = "superman"
printl
printl ("textpool is: " + textinfo)
printl
printl ("we are looking for: " + searchword)
printl
do
scoreahit = instr(searchposition+1,textinfo,searchword)
if scoreahit > 0 then
printl "Position of searching word is: " & scoreahit
end if
searchposition = scoreahit + len(searchword) -1
loop until scoreahit=0
sleep 200
console_writeline
console_writeline ("ok, push a key to end this fantastic script")
waitkey[/code]
ciao, Lionheart
Bookmarks