Results 1 to 3 of 3

Thread: FH Write Block

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2001
    Posts
    1,140

    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.
    Travis, Kung Foo Journeyman
    As always, RTFM.

    WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
    Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
    YBMS, but Mozilla doesn't.

  2. #2
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    As far as I know that type of syntax is unique to Perl (called a 'Here Document' ?).
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Feb 2001
    Posts
    1,140
    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.
    Travis, Kung Foo Journeyman
    As always, RTFM.

    WWW Standards: HTML 4.01, CSS Level 2, ECMA 262 Bindings to DOM Level 1, JavaScript 1.3 Guide and Reference
    Perl: Learn Perl, Llama, Camel, Cookbook, Perl Monks, Perl Mongers, O'Reilly's Perl.com, ActiveState, CPAN, TPJ, and use Perl;
    YBMS, but Mozilla doesn't.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width