lparameters cPrg, cProcName local cText, nAt cText=lower(filetostr(cPrg)) lFound=.f. for i=1 to occurs("proc", cText) nLine=atcline("proc", cText) cLine=mline(cText,nLine) lFound=atc(cProcName, cLine) if lFound exit else cText=subs(cText, _mline) endif endfor return lFoundNow this needs some more checking (i.e. does the cPrg exist etc). It should also be repeated for the Func keyword, and should keep a copy of cText for the second run, because this way cText is being chopped. After a little tweaking this would be stable enough.