Results 1 to 6 of 6

Thread: Problem with quotes in Print statement

  1. #1

    Thread Starter
    Lively Member Patrice Bourdages's Avatar
    Join Date
    Jun 2000
    Location
    Quebec, Canada
    Posts
    83

    Unhappy

    I'm stuck...

    I need to have the following statement (as is) in an output .txt file:
    infile "/export/blabla/hello.txt"

    How the h... do I inclosed those two quotes inside a statement looking like this:
    Print #1, " infile "/export/blabla/hello.txt""

    It doesn't take the double quote thing... I tried tripling it... But to my dismay, it doesn't work at all..

    What should I do...?

    Sincerely,

    Patrice :-)

  2. #2
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    Boulder, Colorado, USA
    Posts
    325
    Well, that's a good question. An easy fix would be to character replace " with ' or something. then when you read the data back replace ' with " in your string.
    -Shickadance

  3. #3
    Guest
    Try this.

    Code:
    Open "C:\windows\desktop\tttt.txt" For Output As #1
    Print #1, Chr(34) & "/export/blabla/hello.txt" & Chr(34)
    Close #1
    Or this.

    Code:
    Open "C:\windows\desktop\tttt.txt" For Output As #1
    Print #1, """/export/blabla/hello.txt"""
    Close #1
    Both should enclose the string in quotes.

  4. #4
    Guest
    Code:
    print #1, chr(34) & "/export/blabla/hello.txt" & chr(34)
    where chr(34) is the ascii character code for the double-quote!

    you may kick yourself now!

  5. #5
    Guest
    bugger! i knew someone would get there a few seconds before me!

  6. #6

    Thread Starter
    Lively Member Patrice Bourdages's Avatar
    Join Date
    Jun 2000
    Location
    Quebec, Canada
    Posts
    83

    Angry

    That easy... Well..

    BANG... Here's the kick in my ...

    Thanks a bunch you guys.

    Appreciate it a lot.

    Sincerely,

    Patrice :-)

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