how to check an undefined command ?

MRL

Usenet Archive
Joined
Jul 8, 2003
Messages
45
Reaction score
0
Hello,

I'm trying to undefine a command in a seperate LISP-file. In my routine the file is loaded twice or more. (That is why i get the error: "unknown command")

(command "._UNDEFINE" "ETRANSMIT")
(defun C:ETRANSMIT
(alert "Do not use this command.")
(prompt "\nDo not use this command.")
(princ)
)

It's to complex in my whole routine to load it once, so how can i check if the command is already undefined?
 
Hello,

I'm trying to undefine a command in a seperate LISP-file. In my routine the file is loaded twice or more. (That is why i get the error: "unknown command")

(command "._UNDEFINE" "ETRANSMIT")
(defun C:ETRANSMIT
(alert "Do not use this command.")
(prompt "\nDo not use this command.")
(princ)
)

It's to complex in my whole routine to load it once, so how can i check if the command is already undefined?

From that comment right there, that's a very good clue that you need to do some major re-writing. You should only have to put your code in 1 place and have it work for everything you need. There should be no need to have the same code in more than 1 place.

To answer your question here is a hack:

(defun undef_etransmit
(if (not #globalUndefEtransmit)
(progn
(command "._UNDEFINE" "ETRANSMIT")
(defun C:ETRANSMIT
(alert "Do not use this command.")
(prompt "\nDo not use this command.")
(princ)
)
(setq #globalUndefEtransmit t)
)
)
(princ)
)

Then just call (undef_etransmit) anytime you want to make sure it's undefined.

Kevin
 

Latest threads

Back
Top