procedure locate(s) count := 0 lineno := 0 while line := read() do { lineno := lineno + 1 if find(s,line) then { write(lineno,": ",line) count := count + 1 } } if count > 0 then return count else fail end