Sign in to follow this  
Followers 0
Mat

FileWrite () adding speech marks ""

10 posts in this topic

#1 ·  Posted (edited)

I want to write a line to a file that includes quote marks.

how should it be done?

I want to write something along the lines of:

Filewrite ("="text and stuff" " & @CRLF & "="more text and stuff" ", 1)

Question no 2

Whats the difference between filewrite and filewriteline

I presume Filewrite accepts @CRLF ????

MDiesel

Edited by mdiesel

Share this post


Link to post
Share on other sites



Like so:

$var = "=""text and stuff"" "

Or ..

$var = '="text and stuff" '

FileWrite is to write anything to a file. FileWriteLine can only add one line to the end of a file.

FileWriteLine is a function for those that are lazy.

Share this post


Link to post
Share on other sites

$var = "=""text and stuff"" "

or

$var = '="text and stuff" '

so what do i do if I intend to do alot of quotation marks in lots of different areas?

Thanks for the reply

MDiesel

Share this post


Link to post
Share on other sites

What I should have said is:

What If I dont want to make lots of variables?

I am probably going to end up using 30+ variables trying to do this.

could I... set $SM = " " "

Then I could just use the one variable over and over again.

Filewrite ("=" & $SM & "text and stuff" & $SM & " & @CRLF & "=" & $SM & "more text and stuff" & $SM, 1)

lol

MDiesel

Share this post


Link to post
Share on other sites

Just use single quotes around the double quotes. No problem here.

Share this post


Link to post
Share on other sites

FileWrite is to write anything to a file. FileWriteLine can only add one line to the end of a file.

FileWriteLine is a function for those that are lazy.

:P

I would have said: They are exactly the same except FileWriteLine() adds an @CRLF at the end of the written string.

Jos


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 would have said: They are exactly the same except FileWriteLine() adds an @CRLF at the end of the written string.

But I think that would be entirely correct because of when dealing with binary data. The help file says that FileWriteLine does not accept null characters. I don't see a purpose for FileWriteLine when we already had FileWrite, anyway.

And sometimes I feel like I am blindly defending what is in the help file...

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