PDA

View Full Version : Tracking Reactor



kennet.sjoberg
2004-10-27, 08:32 AM
I am trying to create a reactor that investigate if any running lisp at the end do not reset the errorhandler
but I do not know what I am doing so I need Your help, please tell me if anything is bad -or good
and if this reactor really can works.

If You do not know how this code work, please do not load it, it may cause You problem.

(getvar "CMDACTIVE" )
1 Ordinary command is active
2 Ordinary command and a transparent command are active
4 Script is active
8 Dialog box is active
16 AutoLISP is active (only visible to an ObjectARX-defined command)
--
31



(defun C:FindWrongErrorHandler ( / )
(setq Anything (vlr-lisp-reactor nil '((:vlr-lispEnded . ErrhReactor ))) )
)
(defun ErrhReactor ( CALL COM / )
(if (= (getvar "CMDACTIVE" ) 31 )
(progn
(if (not *OrgErr* ) (setq *OrgErr* *error* ) ( ) ) ;; Save the initial -default errorhandler
(setq *ActErr* *error* ) ;; Save the present errorhandler after a lisp
(if (eq *OrgErr* *ActErr* ) ;; look if ended lisp program has resetted the errorhandler
( ;| No problem |; )
(progn
(alert "Wrong errorhandler is now present !" )
(princ "\nTRACK THIS ERRORHANDLER AND PROGRAM BELONGING TO IT DOWN\n" )
(princ *ActErr* )
(princ "\nand fix the resetting part in the program, if it is possible.\n" )
(textscr)
)
)
)
( )
)
(princ)
)


: ) Happy Computing !

kennet

kennet.sjoberg
2004-10-27, 12:03 PM
No, it is not working if I (setq *error* nil ) it should alert
do I treat the argument correct ?

: ) Happy Computing !

kennet