on startUp
	put 0 into startOffs
	put true into keepGoing
	put "This foobar foolates fabfoolously" into myStr
	put "foo" into myPattern
	repeat while keepGoing
		put offset( myPattern, myStr, startOffs ) into pos
		if pos = 0 then
			put false into keepGoing
			put return&"no more matches" into dumpMe
		else
			put startOffs +pos into startOffs
			put return & char startOffs to (startOffs+the length of myPattern-1) of myStr into dumpMe
			put return &"'foo' found at:" && startOffs into dumpMe
		end if
	end repeat
end startUp