Or VBScript, as in ...
Const cHor = "Ä", cVert = "³", _
cULCorner = "Ú", cURCorner = "¿", _
cLLCorner = "À", cLRCorner = "Ù"
set con =
CreateObject("Scripting.FileSystemObject").opentextfile("con:", 2)
for each arg in wsh.arguments
s = s & arg & "|"
next
for each line in split(Replace(s & "/", "|/", ""), "|")
if len(line) > l then l = len(line)
next
con.writeline vbnewline & cULCorner & string(l+2, cHor) & cURCorner
for each line in a
con.writeline cVert & " " & line & space(l - len(line) + 1) & cVert
next
con.writeline cLLCorner & string(l+2, cHor) & cLRCorner
The text to be displayed is provided as command line arguments, which
can use vertical bars (|) to deliniate lines withing quoted
arguments. Or separate arguments with spaces. For example, ...
t:\>cscript boxdraw.vbs "This is a paragraph" "with a longer last
line."
or
t:\>cscript boxdraw.vbs "|This is a paragraph|with a longer last
line.|"
The second example puts a black line before and after the paragraph.
This could be converted to a hybrid VBS/batch by ECHOing the script
text into a temproary file and running that script, but I leave that
exercise to the student ;-).
_______________________________________
Tom Lavedas