Hello friends,
Here you see HTML code from MS WORD.
Now I made a function to clean up this source code to use with FIVEWIN reports.
function getHTMLTags()
local cText := memoread("C:\html_reports\quittungClean.html")
local n, cResult := "", nTimes := StrCharCount( cText, "<" ) + 1
local aText := {}
local cPlaceholder := ""
local nAt := 0
local cTextNeu := cText
local aTagsReplace := {}
local I := 0
*----------------------------------------------------------
aTagsReplace := { { "<p ", "<P>"},;
{ "<td ","<td>"},;
{ "<span","<span>"} }
FOR I:= 1 to len(aTagsReplace)
cText := memoread("C:\html_reports\quittungClean.html")
for n = 2 to nTimes
cPlaceholder := StrToken( cText, n, "<" )
nAt := At(">", cPlaceholder )
cPlaceholder := "<"+left( cPlaceholder, nAt )
if cPlaceholder = aTagsReplace[I,1]
AADD( aText, {cPlaceholder,"" } )
cTextNeu := STRTRAN( cTextNeu, cPlaceholder, aTagsReplace[I,2] )
endif
next
memowrit("C:\html_reports\quittungClean.html", cTextNeu)
next
xbrowse( aText )
msginfo( "End" )
return( aText )
//----------------------------------------------------------------------------//
And that is what the code looks after cleaning.
Best regards,
Otto
