TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: HasanCAD on December 14, 2010, 04:49:50 AM

Title: What does this error message mean?
Post by: HasanCAD on December 14, 2010, 04:49:50 AM
When Run a lisp this error message comes but when repeat the same lisp working good

Code: [Select]
; error: An error has occurred inside the *error* functionbad argument type:
VLA-OBJECT nil

This is erorr subroutine
Code: [Select]
(defun *error* (msg)
  (if oldEcho (setvar "CMDECHO" oldEcho))
  (if oSnp (setvar "OSMODE" oSnp))
  (if oZin (setvar "DIMZIN" oZin))
  (if mSp  (vla-EndUndoMark actDoc))
  (princ msg)
  (princ)
)
Title: Re: What does this error message mean?
Post by: Kerry on December 14, 2010, 05:24:23 AM

The only VLA Object there is  actDoc
Perhaps it is nil.
Title: Re: What does this error message mean?
Post by: Kerry on December 14, 2010, 05:36:35 AM

Perhaps add something like this to the *error* function
Code: [Select]
  ;;----- Display error message if applicable _---------------------------
  (cond
    ((not msg))                              ; no error, so do nothing
    ((member (strcase msg t)                 ; if cancel or quit
             '("console break" "function cancelled" "quit / exit abort")
     )
    )
    ((princ (strcat "\nApplication Error: " (itoa (getvar "errno")) " :- " msg))
     ;;----- Display backtrace ------------------------------------------
     (vl-bt)
    )
  )
Title: Re: What does this error message mean?
Post by: HasanCAD on December 14, 2010, 09:01:24 AM
Thanks Kerry