Johntosh Posted December 6, 2008 Posted December 6, 2008 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 Quote
borgunit Posted December 6, 2008 Posted December 6, 2008 You can concatenate the string using chr(34) wherever you need a quotation. VB recognizes that as the quotation mark. LINK: http://www.vbforfree.com/?p=312 Quote
David Bethel Posted December 6, 2008 Posted December 6, 2008 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 Quote
jammie Posted December 6, 2008 Posted December 6, 2008 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 Quote
Lee Mac Posted December 7, 2008 Posted December 7, 2008 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.... Quote
BIGAL Posted December 8, 2008 Posted December 8, 2008 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.... Quote
Recommended Posts
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.