sub HTMLFilter  'DeleteTag
string1$=RichEdit.text

z0=tally (string1$, "<")

Label2.Caption="Total "+str$(z0)+" tags"
 z1=instr(string1$, "<")
 z2=instr(string1$, ">")

  while z1>0 and z2>0 
       
       if HiLight=1 then 'if HiLight'

    		if z2>z1 then 
                RichEdit.SelStart =  z1-1
		RichEdit.SelLength =z2-z1+1
		RichEdit.SelAttributes.Color =clRed
                z1=instr(z2, string1$, "<")
	        z2=instr(z2+1, string1$, ">")
        	goto nxt:
		else 'error in Html'
'<a class="small" target="_top" href="/default.asp">MSDN Home</a>&nbsp;   >   &nbsp;
                z1=instr(z2, string1$, "<")
	        z2=instr(z2+2, string1$, ">")
        	goto nxt:
	        
		end if

        else 'if delete'
	    if z2>z1 then 
		string1$=delete$(string1$, z1, z2-z1+1) '+chr$(10) 
	    else 'error in Html'
'<a class="small" target="_top" href="/default.asp">MSDN Home</a>&nbsp;>&nbsp;
          string1$=delete$(string1$, z2, 1)
	    end if
        
        end if

        z1=instr( string1$, "<")
        z2=instr( string1$, ">")

nxt:
dec z0

Label1.Caption="Remaining "+str$(z0)+" tags"
doevents
if stops=1 then stops=0 :exit sub
  wend

if HiLight=0 then 
RichEdit.Font.Color=clBlue
RichEdit.SelAttributes.Color =clBlue

string1$=REPLACESUBSTR$(string1$,"&nbsp;" , " "  )
RichEdit.text=string1$

end if

end sub 
