>LOCAL lcFile, lnStart, lnStop >lcFile =FileToStr('yahoo.txt') >lnStart = 1 >lnStop = 0 > >DO WHILE lnStart > 0 > lnStart = AT('<', lcFile) > lnStop = AT('>', lcFile) > IF lnStart = 1 > lcFile = SubStr(lcFile, lnStop +1) > ELSE > lcFile = Left(lcFile, lnStart -1) + SubStr(lcFile, lnStop +1) > ENDIF >ENDDO > >=StrToFile(lcFile, 'yahoo2.txt') >This works. However, I need to take care of a specific condition where I may have an end of tag but no beginning of tag such as when using the < syntax to show a beginning of tag character but not being interpreted.
FUNCTION ExtractTag PARAMETER tcContent LOCAL lnStart,lnStop lnStart=1 lnStop=0 DO WHILE lnStart>0 lnStart=AT('<',tcContent) lnStop=AT('>',SUBSTR(tcContent,lnStart)) IF lnStart=0 EXIT ENDIF IF lnStart=1 tcContent=SUBSTR(tcContent,lnStop+1) ELSE tcContent=LEFT(tcContent,lnStart-1)+SUBSTR(tcContent,lnStart+lnStop) ENDIF ENDDO RETURN tcContent