Sign in to follow this  
Followers 0
magOO

How To Write A " With Filewriteline

6 posts in this topic

Hello!

I add some text via FileWriteLine. But now i want to write a " in the Text.

AutoIt stop the script and says that there is a an error.

Can anybody please explain, how i can write a " in a File?

Thanks

magOO

Share this post


Link to post
Share on other sites



Hello!

I add some text via FileWriteLine. But now i want to write a " in the Text.

AutoIt stop the script and says that there is a an error.

Can anybody please explain, how i can write a " in a File?

Thanks

magOO

FilewriteLine("filename", '"')

certainly difficult to read it is a ' followed by " followed by '.

That second manner to protect string.

THe idea is when you need one inside you use the other to protect :whistle:

Share this post


Link to post
Share on other sites

Since quotes can be tricky, I tend to use Chr(34) to insert double quotes:

FileWriteLine($FileHandle, "Quoted text follows:  " & Chr(34) & "Hello" & Chr(34))

Guess there's always more than one way to swing a dead cat. :whistle:

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Guess there's always more than one way to swing a dead cat. B)

yeap, and this way will also work: """" :whistle:

but i prefer JPM's way... '"'

Edited by JdeB

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

Share this post


Link to post
Share on other sites

If you forget chr():

$q='"'
$q2="'"
MsgBox(1,"...and he said",$q2&"Quotes are fun" & $q2 &@CRLF& $q &"Quite fun" &$q)

AutoIt3, the MACGYVER Pocket Knife for computers.

Share this post


Link to post
Share on other sites

Thanks To All For Your Help! :whistle:

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