Hi guys,
Does anyone have experience with the issue I'm trying to figure out:
(defun C:testf ( / *error* rtn )
(defun *error* ( msg )
(if *LoadTestLspFilePath* (setq *LoadTestLspFilePath* nil)) ; not sure where to reset this variable to nil
(if (or (not (member msg '("Function cancelled" "quit / exit abort"))) (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")) (princ (strcat "\nError: " msg)))
(princ)
); defun *error*
(if (or *LoadTestLspFilePath* (setq *LoadTestLspFilePath* (getfiled "Specify lisp file to load" "C:\\Users\\Grrr\\Desktop" "lsp" 0)))
(if (not (vl-catch-all-error-p (setq rtn (vl-catch-all-apply (function load) (list *LoadTestLspFilePath*)))))
(princ (strcat "\nLisp file is loaded!\n" rtn))
(princ (strcat "\nError occured:\n" (vl-catch-all-error-message rtn)))
)
)
(princ)
);| defun |; (or (vlax-get-acad-object) (vl-load-com)) (princ)
The above code does not work, I am posting it so you can have an idea what I am attempting, I get the following error:
Command: TESTF
Error: bad argument type: stringp
I am trying thru this lisp code, once to prompt for a .lsp file to be loaded using (getfiled), and everytime when I want to reload it, just to call the command "testf".
The reason for that is that I prefer using notepad++ , if I don't have to debug and/or trace errors in the code (with VLIDE).
But everytime I make some modification I have to call "APPLOAD" to test the code again and again... which is very uncomfortable so I'm attempting such alternative.