LISP
LISP
(OP)
Hi there,
is it possible that when i'm executing a lisp program and i'm aborting it in the middle of the run with "Escape" that when that happens a few codelines will be executed.
Yes? Tell me how to write tis down please.
regards,
HMO
is it possible that when i'm executing a lisp program and i'm aborting it in the middle of the run with "Escape" that when that happens a few codelines will be executed.
Yes? Tell me how to write tis down please.
regards,
HMO





RE: LISP
<Yes? Tell me how to write tis down please>
I'm not understanding this question. Could uou please rephrase it?
RE: LISP
1) Save the existing error function with this statement:
(setq olderr *error*)
2) Define a new function to intercept the ESC or other errors with something like this:
(DEFUN NewErr(s) ; Error handler
(SetVar "OSMODE" om)
(SetVar "CMDECHO" 0)
(setq *error* olderr)
(setq ans "An Error has ocurred")
(prompt ans)
(princ)
)
3) After the DEFUN in (2) above include the following:
(setq *error* NewErr)
3) At the end of your LISP routine, to make sure the error functin is restored to it's previous setting, add:
(setq *error* olderr)
This will hopefully get you started.
RE: LISP
However when i'm in the middle of the function and i want to abort it with "escape" the variables will not be set back to their original values saved in the beginning of the function.
Is it possibles to program the function so that when i'm aborting the function in the middle of the program that the original values of the variables saved in the beginning of that function will be set back to theirsoriginal values?
I'm just aasking of this is possibles and if the answer is yes how to do this?
RE: LISP