lparameters tcText n=alines(aRows, tcText) for i=1 to n aRows[i]=allt(chrtran(aRows[i], chr(9), " ")) && trim out any leading tabs endfor dimension aRows[n,1] && make it 2-dim for Append create cursor crsRows (cRow c(200), nLevel i) append from array aRows lnLevel=0 scan do case case lower(cRow)="with " lnLevel=lnLevel+1 case lower(cRow)="endwith " lnLevel=lnLevel-1 enddo replace nlevel with lnLevel endscan browse for cRow="retu" and nLevel>0Of course, you can add row numbers and other stuff, make things easier to find in code references, etc. No guarantee, batteries not included, just an idea, code off headtop.