Here is my simple code, but vary powerful if you want to implement dcl content into lsp file... Of course, you have to edit main lsp with these lines :
(setq fname (vl-filename-mktemp nil nil ".dcl"))
(setq fn (open fname "w"))
After that comes the part from successful conversion of dcl content to lsp in form :
(write-line "... ... \" ... ... \" ... ..." fn)
(write-line "... ..." fn)
...
Then comes these final lines :
(close fn)
(vl-file-delete fname)
So, here is my conversion dcl2lsp.lsp :
(defun c:dcl2lsp ( / fname1 fn1 fname2 fn2 k fn1l fn2l )
(setq fname1 (getfiled "Select DCL file" "" "dcl" 16))
(setq fn1 (open fname1 "r"))
(setq fname2 (getfiled "File to save" "" "lsp" 1))
(setq fn2 (open fname2 "w"))
(while (setq fn1l (read-line fn1))
(setq fn2l fn1l)
(setq k 0)
(while (setq k (vl-string-search "\"" fn2l k))
(setq fn2l (vl-string-subst "\\\"" "\"" fn2l k))
(setq k (+ k 2))
)
(setq fn2l (strcat "(write-line \"" fn2l "\" fn)"))
(write-line fn2l fn2)
)
(close fn1)
(close fn2)
(princ)
)
I hope, that you'll find this useful... Someone, like me want to have everything in *.lsp, for if separate main lsp code from dcl, you have to put both files in CAD support search path, and load *.lsp from there... This way, if you have all in single *.lsp, you can load it from anywhere and not worry if dialog box will show up or not (it must show up)...
M.R.