Jump to content

Need help with write-line


plecs

Recommended Posts

I say 30 variables that I want to write the values ​​without quotation marks.

* only a comma between values

 

(setq ax1 (strcat "Euro" "," "EU7X50" "," euro))
(setq ax2 (strcat "Hol2.5x25" "," "HZ2.5X25" "," hz))
(defun c:writeacc (/ cfgfname SymList)
(vl-load-com)
(setq cfgfname "RaportACCESORI.txt")
(setq SymList '(ax1 ax2 ax3 ax4 ax5 ax6 ax7 ax8 ax9 ax10 ax11 ax12 ax13 ax14 ax15 ax16 ax17 ax18 ax19 ax20 ax21 ax22 ax23 ax24 ax25 ax26 ax27 ax28 ax29 ax30))
(LM:WriteConfig cfgfname (mapcar 'eval SymList))

 (princ)
)
(princ)
;=========================================================================================
 (defun LM:WriteConfig ( filename lst / ofile )
 (setq filename "RaportACCESORI.txt")
(if (setq ofile (open filename "a")) 
   (progn
       (foreach x lst (write-line (vl-prin1-to-string x) ofile))
             (setq ofile (close ofile))
       T
     )
   )
 )

how can I remove the quotes marks

[color="red"]"Euro_7x50,EU7X50,8"[/color]
[color="red"]"Hol_2.5x25,HZ2.5X25,31"[/color]
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil
nil

Link to comment
Share on other sites

If all the ax? values are strings why not just (write-line x ofile)

 

Just me but when I was taught programming and you would use variables like X Y I J K as numbers so I would do (write-line ans ofile) there is lot of old school people here and like me they would see a X as a number at first glance.

Link to comment
Share on other sites

  • 3 weeks later...

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...