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
you can't always get what you want, but if you try sometimes you might find, you get what you need
Nice example Lionheart. Few lines of code and it does quite a bit, the power of thinBasic!
Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server
Bookmarks