While it is probably possible to test for evey possible scenario prior to
calling a set_mode or any other function, it is far more straight forward ( IMO )
to issue an (exit) / (quit) and have the error handler cancel out any active command
, end the undo group and then undo all changes to database, and then issue the
return_mode function in a single step.
;++++++++++++ Set Modes & Error ++++++++++++++++++++++++++++++++++
(SetUndo)
(and (/= msg
"quit / exit abort") (nw_rmd)))
;++++++++++++ Return Modes & Error +++++++++++++++++++++++++++++++
;++++++++++++ Set And Start An Undo Group ++++++++++++++++++++++++
(command "_.UNDO" "_CONTROL" "_ALL"))
;++++++++++++ Test Bed +++++++++++++++++++++++++++++++++++++++++++
(defun c:exitquit
(/ olderr a
)
(nw_smd)
(alert "This Program Only Work In Release 13 For Windows")
(nw_rmd)
Without using the *error* handler, INSBASE remains '(1 1 0)
Also any geometry created prior to the abort remains.
This is a scenario I have due the fact my rendering program only runs in Release 13 Windows.
But only if I choose a AccuRender2 as an option. If it is a hidden line, shaded surface, wireframe image,
the autocad release doesn't matter.
If the value is an option based on user inputs nested deeply in the main program, thats a lot
code to have to clear out.
I'm sure there are arx programs that have similar limitations and simply exit when
trying to be loaded on incorrect platforms.