Cliff Posted yesterday at 03:09 PM Posted yesterday at 03:09 PM Back in the day (Autocad 14 or so) the autolisp interpreter would spit out the variable names in the line of code that bombed instead of the values (example below), making it much easier find the problem. This may be a newbie question from an old-timer. I never took the pains to learn the VLIDE. Is there something there that solves the problem? Error: bad argument type: numberp: nil Backtrace: [0.57] (VL-BT) [1.53] (#<SUBR @0000018680e21a98 -lambda-> "bad argument type: numberp: nil") [2.49] (ill-fun-hk "bad argument type: numberp: nil") [3.44] (((MSG) (IF (NOT (MEMBER MSG (QUOTE ("console break" "Function cancelled" "quit / exit abort" "")))) (PROGN (PRINC (STRCAT "\nError: " MSG)) (IF *DEBUG* (VL-BT))))) "bad argument type: numberp: nil") [4.39] (_call-err-hook ((MSG) (IF (NOT (MEMBER MSG (QUOTE ("console break" "Function cancelled" "quit / exit abort" "")))) (PROGN (PRINC (STRCAT "\nError: " MSG)) (IF *DEBUG* (VL-BT))))) "bad argument type: numberp: nil") [5.33] (sys-error "bad argument type: numberp: nil") :ERROR-BREAK.28 nil [6.25] (- nil 8.48089) [7.19] (C:GT) [8.15] (#<SUBR @0000018680872c50 -rts_top->) [9.12] (#<SUBR @00000186807c8700 veval-str-body> "(C:GT)" T #<FILE internal>) :CALLBACK-ENTRY.6 (:CALLBACK-ENTRY) :ARQ-SUBR-CALLBACK.3 (nil 0) Quote
GLAVCVS Posted yesterday at 07:35 PM Posted yesterday at 07:35 PM Hi If you need to locate where the error occurred during execution, once it has happened, press CTRL-F9 and VLIDE will show you the expression where the error occurred, highlighted. I hope this answers your question correctly Quote
Cliff Posted yesterday at 07:47 PM Author Posted yesterday at 07:47 PM Thank you for the reply, but sad to say I do not even know how to execute a program from the vlide. Quote
mhupp Posted yesterday at 10:56 PM Posted yesterday at 10:56 PM 3 hours ago, Cliff said: Thank you for the reply, but sad to say I do not even know how to execute a program from the vlide. https://www.afralisp.net/visual-lisp/tutorials/visual-lisp-editor-part-1.php Quote
Lee Mac Posted 14 hours ago Posted 14 hours ago (edited) FWIW, the output you are describing comes from the undocumented (vl-bt) function, e.g.: (defun c:test ( / *error* ) (defun *error* ( m ) (vl-bt) (princ)) (/ 1 0) ) Command: TEST Backtrace: [0.50] (VL-BT) [1.46] (*ERROR* "divide by zero") LAP+7 [2.40] (_call-err-hook #<USUBR @0000021d551441b0 *ERROR*> "divide by zero") [3.34] (sys-error "divide by zero") :ERROR-BREAK.29 "divide by zero" [4.26] (/ 1 0) [5.20] (C:TEST) LAP+33 [6.15] (#<SUBR @0000021d55144278 -rts_top->) [7.12] (#<SUBR @0000021d532d8700 veval-str-body> "(C:TEST)" T #<FILE internal>) :CALLBACK-ENTRY.6 (:CALLBACK-ENTRY) :ARQ-SUBR-CALLBACK.3 (nil 0) Edited 14 hours ago by Lee Mac Quote
Cliff Posted 14 hours ago Author Posted 14 hours ago Thanks for responding. That is correct. I put (vl-bt) in my *error* functions, otherwise I have zero idea where the error occurred. However, I don't know the name of the variable in the errant line of code, only the values. That isn't always easy to spot. I was able to load and run code thru the vlide, but using CNTL-F9 did not show the line where the error occurred, just this dialog. And setting "Break on Error" didn't do what AI told me it would...When it crashes, VLIDE will freeze the execution and highlight the problematic line in your source code. Quote
Lee Mac Posted 14 hours ago Posted 14 hours ago Perhaps my tutorial on debugging with the VLIDE will help? https://lee-mac.com/debugvlide.html Quote
Cliff Posted 13 hours ago Author Posted 13 hours ago 9 minutes ago, Lee Mac said: Perhaps my tutorial on debugging with the VLIDE will help? https://lee-mac.com/debugvlide.html Thanks again. I just need to remember that CNTL F9 only works when I do not mouse-click on vlisp console first. Quote
SLW210 Posted 12 hours ago Posted 12 hours ago You might want to look into using Visual Studio Code, it is replacing the VLIDE in newer AutoCAD versions. I have some links to more information in this thread... Quote
Recommended Posts
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.