If you want to involve error handling, there's now a simpler way to do that. It hasn't always been available, so you'll find lots of examples of the older more complicated way in the Discussion Group history.
For a few versions now, you've been able to define the *error* function as if it were a variable, *inside* a larger function definition, and localize it. That way, it will only apply within that routine, and you don't need to save the current [presumably AutoCAD's native] error handling, and restore it later, or deal with a variable to do all of that with.
The Line command will provide its own prompt, so there's really no need for the point variables and (getpoint) functions.
^C means nothing in Lisp -- it's macro language. It only works here *because* it means nothing, that is, it returns nil, and that happens to end some commands. You would get the same effect by using MarilynMonroe [provided you haven't set a value to that as a variable]. The better way to end a command such as Line or Layer or Chprop is with Enter, or in Lisp terms, "".
This will do exactly the same:
{code}
(defun D:Dline (/ *error*)
(defun *error* (errmsg)
(princ errmsg)
(setvar 'orthomode orthomode)
); end defun - *error*
(setq orthomode (getvar 'orthomode))
(setvar 'orthomode 1)
(command "line" pause pause "")
(setvar 'orthomode orthomode)
(alert "Hello")
(princ)
); end defun - Dline
{code}
--
Kent Cooper
Kent Cooper, AIA