-
FH Write Block
I want to write a block of text to a filehandle, and I'm wondering there is an easy way to do this in VBScript.
If I were using PerlScipt I would do something like...
Code:
write myFH, <<<END
<p>This is my HTML enriched block of text that may contain
"quotes" as well as some $aspVariables. The variables should be
should be replaced as neccesary but the quotes should be ignored.</p>
END
My PerlScript syntax may be off a little, but I think you get the idea. I just hate using myFH.Write() over and over again.
-
As far as I know that type of syntax is unique to Perl (called a 'Here Document' ?).
-
Yes, it is called a here document.
Though, you could do something similar (minus CrLf and foratting) if you just leave the quotes open.
Code:
write myFH, "This is my
test text that I want to write.
Until I close the quotes, it is find. But I have to \"escape\" any quotes
I use.";
To do that in VB requires lots of underscores, which have to be outside quoted material, so you get a lot of ampersand underscore.
I was hoping there was something I wasn't familiar with (and apparently not documented). But I can't find anything.