Results 1 to 2 of 2

Thread: searching for a word :)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Senior Member Lionheart008's Avatar
    Join Date
    Sep 2008
    Location
    Germany, Bad Sooden-Allendorf
    Age
    52
    Posts
    944
    Rep Power
    111

    searching for a word :)

    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
    Attached Images Attached Images
    Attached Files Attached Files
    you can't always get what you want, but if you try sometimes you might find, you get what you need

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •