We have an application that needs to be able to dynamically write data to an HTML file from a subroutine. I have a routine that will write the basic structure of the HTML file only once, such as HTML, head, title, body and table. However, when the program launches again it will write these sections again. Is there any UDF's available to automate writing HTML to a file or could someone maybe let me know of a better way to accomplish writing html locally? Basically, in a nutshell my problem is that I need to write to a table more than once throughout the duration of the program without having to setup the html file over again. This should give you an idea for what I'm trying to do. #include <MsgBoxConstants.au3>
#include <File.au3>
Local $file = Null
_Main()
Func _Main()
WriteHtmLog("It works!", "It works!!", "It works!!!")
EndFunc
Func _SetupWriter()
$file = FileOpen("log.html", 1)
;FileWrite($file, "<html><head><title></title></head><body><table border='1' style='width=100%'>")
;FileWrite($file, "<tr><td>Time & Date</td>")
;FileWrite($file, "<td>Client Info</td>")
;FileWrite($file, "<td>Data</td></tr>")
EndFunc
Func _CloseWriter()
FileWrite($file, "</table></body></html>")
FileClose($file)
EndFunc
Func WriteHtmLog($var1, $var2, $var3)
_SetupWriter()
FileWrite($file, "<tr><td>" & $var1 & "</td><td>" & $var2 & "</td><td>" & $var3 & "</td></tr>")
_CloseWriter()
EndFunc