Jump to content

Recommended Posts

Posted

How does one write double quotes to a file?

 

for example:

 

(write-line "alpha beta alpha beta "delta" alpha beta alpha beta")

 

N.B. delta should have double quote marks, I need it all on one line so this discounts write-char (I think)?

 

Thanks for any help on this

Posted

Check out the 'Control Character in Quoted Strings' topic in the Vlisp help. It is actually a good one.

 

At least that's how it is listed in A2K help. -David

Posted

Following on the above replies, prefix a quote with a backslash to output it as a literal string

 

 

\"delta\" will output as "delta"

 

(write-line "alpha beta alpha beta \"delta \" alpha beta alpha beta")

 

Regards,

 

Jammie

Posted

As in Jammie's example above - the \ (backslash) character prefix will allow the subsequent character to be read as a string instead of a syntax.

 

i.e.

 

\\ = \

\" = "

\n = new line

\t = tab

 

etc

 

And so, if you want to specify for example a filepath, one must include the double backslash to indicate a single:

 

C:\\Users\\Lee Mac\\Documents....

Posted

This may also be a way around another problem of spaces in directory names the path stops at a space using lisp, had to resort to VBA to get around it.

 

C:\\Users\\Lee Mac\\Documents....

or

C:\\Users\\Lee\ Mac\\Documents....

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...