hi groupies,
o.k., so this is pretty trivial, but may save somebody
the 10 minutes or so that it would take to write for
yourself.
There are some webpages which present sample code which is
embedded in "pre" tags -- and so the lines don't end with
vbCrLf's, rather they end with "br" tags. Also, there are
other re-codings, such as the ampersand, less than,
greater than, and etc.
Here is the code used to convert some (html-formatted)
source code back into vb/vbs source. The procedure was
to "view source" on the html page showing the code, extract
the text inside the "pre" tags, and then run this:
--- <code> ---
Const htmlFile = "callDLL_Example1.txt"
Const basFile = "callDLL_Example1.bas"
Const ForReading = 1, ForWriting = 2
Dim fso : Set fso = CreateObject("Scripting.FileSystemObject")
Dim oFile : Set oFile = fso.OpenTextFile(htmlFile, ForReading)
Dim fHTML : fHTML = oFile.ReadAll
Dim fBAS
fBAS = Replace(fHTMl, "<br>", vbCrLf)
fBAS = Replace(fBAS, " ", " ")
fBAS = Replace(fBAS, " ", " ")
fBAS = Replace(fBAS, "&", "&")
fBAS = Replace(fBAS, "<", "<")
fBAS = Replace(fBAS, ">", ">")
Set oFile = fso.OpenTextFile(basFile, ForWriting, True)
oFile.Write fBAS
oFile.Close
MsgBox("finished")
WScript.Quit
--- </code> ---
As you can probably tell, the script assumes that all the
relevant files (including the script itself) are all
located in the current working directory.
cheers, jw