$TYPECHECK ON
CONST CRLF = CHR$(13) & CHR$(10)
CONST Html_CloseFont = "</FONT>"
CONST Html_CloseTable = "</TABLE>"
DIM Html_row_Face AS STRING
DIM Html_row_Color AS STRING
DIM Html_row_Size AS STRING
DIM Html_row_Bold AS INTEGER
FUNCTION Html_InsertLink(file AS STRING, text AS STRING) AS STRING
result = "<a href=" & file & ">" & text & "</a>"
END FUNCTION
FUNCTION Html_InsertImage (file AS STRING, w AS INTEGER, h AS INTEGER) AS STRING
result = "<img src=" & CHR$(34) & file & CHR$(34) & _
"Width=" & STR$(w) & " Height=" & STR$(h) & ">"
END FUNCTION
FUNCTION Html_InsertAnchor (Name AS STRING) AS STRING
Result = "<a name=" & CHR$(34) & Name & CHR$(34) & "></a>
end function
'______________________________________________________________________________
Function Html_RowFont (row as string) as string
Dim FontTemp as string
if Html_row_bold = 1 then
row = replacesubstr$(row, "<td>", "<td><b>")
row = replacesubstr$(row, "</td>", "</b></td>")
End if
FontTemp = "<"FONT
If Len(Html_row_Face) > 0 then _
FontTemp = FontTemp & " Face=" & CHR$(34) & Html_row_Face & CHR$(34)
If len(Html_row_Color) > 0 then _
FontTemp = FontTemp & " COLOR=" & Html_row_color
If Len(Html_row_Size) > 0 then _
FontTemp = FontTemp & " size=" & Html_row_Size
FontTemp = FontTemp & ">"
row = replacesubstr$(row, "<td>", "<td>" & FontTemp)
row = replacesubstr$(row, "</td>", "</FONT></td>")
result = row
End function
'______________________________________________________________________________
Function Html_TableRow (rowstring as string, separator as string, _
Formatted as integer) as string
Dim output as string
output = "<tr><td>"
output = output + replacesubstr$(rowstring, separator, "</td><td>")
output = output + "</td></tr>"
if Formatted = 1 then output = Html_RowFont(output)
result = output
end function
'______________________________________________________________________________
Function Html_MultiRow (stringlist as qstringlist, _
separator as string) as string
Dim output as string
output = ""
dim x as integer
dim count as integer
count = stringlist.itemcount
if count = 0 then result = ""
x = 0
do
output = output + html_tablerow(stringlist.item(x), separator, 1)
output = output + CRLF
inc(x)
loop until x = count
result = output
end function
'______________________________________________________________________________
Function Html_TableHeader (Columns as string, bgColor as string, _
Bordersize as string, BorderColor as string, CellPadding as string, _
Cellspacing as string, Collapse as integer) as string
Dim bCollapse as string
bcollapse = ""
if collapse = 1 then bcollapse = "style=" & chr$(34) & _
"border-collapse: "collapse & CHR$(34)
Result = "<TABLE width="100% & _
" border=" & Bordersize & _
" BgColor=" & BgColor & " " & _
bcollapse & CRLF & _
" BorderColor=" & Bordercolor & _
" Cellpadding=" & Cellpadding & _
" CellSpacing=" & CellSpacing & ">" & _
"<TR><TH>" & replacesubstr$(Columns, ",", "</TH><TH>") & _
"</TH></TR>" & CRLF
End function
|