Code archives/File Utilities/Code2HTML

This code has been declared by its author to be Public Domain code.

Download source code

Code2HTML by XtremeCoder
(Posted 19 years ago)
Turns code into an HTML file, good for open source distributions... Sometimes/rarely the code will come out formatted and centered for whatever reason... depending on your code that may or may not happen...
Function Code2HTML(file$,author$)
codefile=OpenFile(file$)
htmlfile=WriteFile(file$+".html")
	WriteLine(htmlfile, "<html>")
	WriteLine(htmlfile, "<head><title>"+ file$ + "</title></head>")
	WriteLine(htmlfile, "<body bgcolor=000000 Text=66CCFF >")
	WriteLine(htmlfile, "<center>")
	WriteLine(htmlfile, "<h1>"+ file$ + "</h1>")
	WriteLine(htmlfile, "<p><h3>Date: "+ CurrentDate() + "</h3>")
	WriteLine(htmlfile, "<h3>Author: "+ author$ +"</h3>")
	WriteLine(htmlfile, "</center>")
	WriteLine(htmlfile, "<hr>")
	WriteLine(htmlfile, "<center>")
	WriteLine(htmlfile, "<h2>Code:</h2>")
	WriteLine(htmlfile, "</center>")
		While Not Eof(codefile)
			ReadCode$ = ReadLine( codefile )
			WriteLine(htmlfile, "<p>"+ReadCode$)
		Wend
	WriteLine(htmlfile, "</body>")
	WriteLine(htmlfile, "</html>")
CloseFile(htmlfile)
CloseFile(codefile)
End Function