For those without the convenience of MPEX, you can use the following Qedit
command file which does something similar; you have to open the file first.
(from the :While command in the Qedit manual)
PARM string
setjcw cierror = 0
continue
/findq "!string" first
while cierror=0 do
/list *-5/*+5
display
continue
/findq "!string"
endwhile
/Dave Lo