Sign in to follow this  
Followers 0
banford

Enclosing A Double Quote Within A String

4 posts in this topic

Hello all. I am trying to do a filewrite statement that will concatenate multiple string values together so that I can paste the results into a query. The actually text pieces for the query are from a variable thats fed by a loop. The database program that I am using requires that each value be placed in double-quotes. Since the double-quotes also define when a text string starts and stops I get errors when I do the following piece of code:

FileWrite ("c:\SMS_in_qry.txt", """ & $rdline & "",")

The desired result is a list like this: machine1, machine2,..

What I currently do is this:

FileWrite ("c:\SMS_in_qry.txt", "#" & $rdline & "#,")

I then replace #s with . I was wondering if there was a special character or method for enclosing a double quote by itself within double-quotes to get this desired effect. Thanks!

Share this post


Link to post
Share on other sites



Just use single quotes to wrap the double quotes that you want to keep.

FileWrite ("c:\SMS_in_qry.txt", '"' & $rdline & '",')

Share this post


Link to post
Share on other sites

Just use single quotes to wrap the double quotes that you want to keep.

FileWrite ("c:\SMS_in_qry.txt", '"' & $rdline & '",')
Worked like a charm. Thank you very much!

Share this post


Link to post
Share on other sites

$a="cippolippo was here"

;$a="" & $a & ""

$a=""&chr(34) & $a & chr(34) & ""

MsgBox(262144, "", $a)

;$a=""& $a &""

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0