Untested, but according to my knowledge, it should work...
(defun C:DC (/ *error* qaf a b)
(defun *error* (m)
(if qaf (setvar 'qaflags qaf))
(if m (prompt m))
(princ)
)
(setq qaf (getvar 'qaflags))
(setvar 'qaflags 1)
(princ "\nSelect pline to DECURVE: ")
(setq a (ssget "_+.:E:S:L" '((0 . "LWPOLYLINE"))))
(setq b (ssname a 0))
(command "_.pedit" b "d" "")
(command "_.explode" b)
(command "_.join" "p" "")
(*error* nil)
)
BTW. Always localize your variables...