Sign in to follow this  
Followers 0
deltaepsylon

Filewrite with quotes

4 posts in this topic

#1 ·  Posted (edited)

I have tried everything i can think of, and ive looked thru the help but i dont really know where to look.

Anyways, im trying to write the following to a text file

someone "[variable goes here]"

But I cant get the quotes to write!

Im using FileWriteLine

FileWriteLine (@ScriptDir&"\out.txt", "someone ""&$var&""" )

;the error is here  ---------------------------^  ------^
;because there is an unclosed quote

How can I get FileWriteLine to write out the quote?

Edited by deltaepsylon

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

FileWriteLine (@ScriptDir&"\out.txt", "someone """ & $var & """" )

-or -

FileWriteLine (@ScriptDir&"\out.txt", 'someone "' & $var & '"' )

Edited by JdeB

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

I have tried everything i can think of, and ive looked thru the help but i dont really know where to look.

Anyways, im trying to write the following to a text file

someone "[variable goes here]"

But I cant get the quotes to write!

Im using FileWriteLine

FileWriteLine (@ScriptDir&"\out.txt", "someone ""&$var&""" )

;the error is here  ---------------------------^  ------^
;because there is an unclosed quote

How can I get FileWriteLine to write out the quote?

Check FAQ #7.

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

FileWriteLine (@ScriptDir&"\out.txt", "someone """ & $var & """" )

-or -

FileWriteLine (@ScriptDir&"\out.txt", 'someone "' & $var & '"' )

That gave me the error "Unterminated String"

Edit: The first one err'd, the second one worked perfectly. Thanks!

Edited by deltaepsylon

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