TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: DanB on June 02, 2005, 09:51:38 AM

Title: Inches Mark in Quotes
Post by: DanB on June 02, 2005, 09:51:38 AM
I'm having trouble creating the following text string output in LISP.

Code: [Select]

  (setq string1 (strcat (rtos dist1 2 0) " LF OF 8" PVC @ 0.36%"  ))


I am aware there is an issue with my quotation marks (possibly lack of them) where I would like the output string to look like this (example):
  185 LF OF 8" PVC @ 0.36%
I cannot get the Inch mark after 8 to display. Any suggestions?

Thanks,
Dan
Title: Inches Mark in Quotes
Post by: DanB on June 02, 2005, 09:53:55 AM
Nevermind, after some further "testing" I figured it out. The code should read:

Code: [Select]

  (setq string1 (strcat (rtos dist1 2 0) " LF OF 8\" PVC @ 0.36%"  ))


At least this appears to be working.
Title: Inches Mark in Quotes
Post by: Mark on June 02, 2005, 10:09:16 AM
You can also use chr as in;
Code: [Select]

Command: (princ (strcat (chr 34)"This"(chr 34) " is in quotes"))(princ)
"This" is in quotes

Command: (ascii "\"")
34