lcFile = "myFile.txt" lcJoint = "my joint text" lcSearchText = "my search text" Clear ? "Doing search 1" Search1(m.lcFile, m.lcJoint, m.lcSearchText) ? ? ? "Doing search 2" Search2(m.lcFile, m.lcJoint, m.lcSearchText) Function Search1(tcFile, tcJoint, tcSearchText) * no Memowidth setting - supports lines over 1024 Local Array arrLines[1] Local ix,jx,lnLines lnLines = Alines(arrLines, Filetostr(m.tcFile)) For ix=1 To lnLines If Atc(m.tcJoint,arrLines[m.ix]) > 0 && Found start point ? m.tcJoint +"found on line#",m.ix ? arrLines[m.ix] For jx=m.ix+1 To lnLines If Atc(m.tcSearchText,arrLines[m.jx]) > 0 ? m.tcSearchText+" found at line#", m.jx ? arrLines[m.jx] *perform some calculations Exit Endif Endfor Exit Endif Endfor Function Search2(tcFile, tcJoint, tcSearchText) * Memowidth dependant - a line would be accepted 1024 at max in length Set Memowidth To 1024 Local lcContent, lnStartLine, lnSearchLine lcContent = Filetostr(m.tcFile) lnStartLine = Atcline(m.tcJoint, m.lcContent) If m.lnStartLine<>0 &&found joint line ? m.tcJoint +"found on line#",m.lnStartLine ? Mline(m.lcContent,m.lnStartLine) lnSearchLine = Atcline(m.tcSearchText,Substr(m.lcContent,_Mline)) If m.lnSearchLine > 0 ? m.tcSearchText+" found at line#", m.lnStartLine + m.lnSearchLine - 1 ? Mline(m.lcContent, m.lnStartLine + m.lnSearchLine - 1) *perform some calculations Endif EndifCetin