Breaking out of loops when / if

I am new to senseTalk, please help me with ending a loop if I can not scroll anymore.

repeat while not imageFound(“item_to_click”)
click “scroll_bar” – can be the arrow or the track
end repeat

however I do not want to keep looping forever if the image is not found
if the scrollbar is at the end and I can not scroll anymore, I want to be able to break out of the loop and also have a boolean to keep track of it.

Here the pseudo code

repeat while not imagefound (“myItem”)
if(“scrollNoMore”) exists then
break out of the while loop (how to do this?)
varibleboolean=false (how to do this?)
click (“scroll”)
end repeat

repeat while not imagefound ("myItem")
     if("scrollNoMore") exists then
            set varibleboolean to false
            exit repeat
             click ("scroll")
     end if
end repeat