Author Topic: (code) vl-filename-mktemp  (Read 2425 times)

0 Members and 1 Guest are viewing this topic.

Mark

  • Custom Title
  • Seagull
  • Posts: 28678
(code) vl-filename-mktemp
« on: December 12, 2003, 07:47:29 AM »
Something to think about when you want to make ->load ->run -> delete some code.
Code: [Select]
(defun mst-run_remove ( / tf tfo)
  (if (setq tf (vl-filename-mktemp nil nil ".tmp"))
    (setq tfo (open tf "w")))

 (if tfo
    (progn
      (write-line "(defun me1 (/ name age)" tfo)
      (write-line "(if (setq name (getstring T \"\\nEnter Your Name: \"))" tfo)
      (write-line "(setq age (itoa (getint \"\\nEnter Your Age: \")))" tfo)
      (write-line ")" tfo)
      (write-line
(strcat
 "(alert (strcat \"Thanks for that info \"name\"\\nI did not know you were \"age))"
 )
tfo
)
      (write-line ")" tfo)
      )
    )
  (close tfo)
  (load tf)
  (me1)
  (if (vl-file-delete tf)(princ "\nCleanup finished"))
  (princ)
  )
TheSwamp.org  (serving the CAD community since 2003)