PDA

View Full Version : Routine to compile ALL your .LSP files into a .FAS file



Adesu
2007-03-02, 09:22 AM
Hi Alls,
if you have 500 file lsp,and you got trouble to compile alls lsp file to fas file ,because it work one by one,I have solution to alls lsp file in one second,try it.
here that code


; cltf is stand for Convert Lsp To Fas
; Design by : Adesu <Ade Suharna>
; Email : mteybid@yuasabattery.co.id
; Homepage : http://www.yuasa-battery.co.id
; Create : 02 March 2007
; Program no.: 0552/03/2007
; Edit by :
; Idea from : Jim Dee at www.caddee.com
; Remark : before run this program,you sould prepare folder for
; destination object
(defun c:cltf (/ lsp fas lst)
(setq lsp (dos_getdir "Browse for folder" " " "Select a folder as source" t))
(setq fas (dos_getdir "Browse for folder" " " "Select a folder as destination" t))
(setq lst (vl-directory-files lsp "*.lsp" 1))
(if
lst
(progn
(foreach x lst
(vlisp-compile
'st
(strcat lsp x)
(strcat fas (substr x 1 ( - (strlen x) 4)) ".fas")
)
) ; foreach
) ; progn
(alert "There is not contained file")
) ; if
(princ)
) ; defun

robert.1.hall72202
2007-03-02, 01:31 PM
Nice. I could see this coming in handy.

So this would load an entire directory of lisp routines?

madcadder
2007-03-02, 01:34 PM
Nice w/ two comments:

1. Isn't "dos_getdir" from doslib and you would need that add-on to run this?

2. You can use "VL-MKDIR" to create the folder with the lsp.