just to answer my own curiosity, is there any difference between the
AutoLisp functions (quit) and (exit)?
When and how do you folks use them?
Thanks
--
Kevin Hayward
WLB Group
; Tony Tanzillo
; name is NOT case-senseitive
; must include .dwg
; Return: Document object if open, or NIL
(defun isDocOpen(name / temp)
(setq name (strcase name))
(vl-catch-all-apply
'(lambda ()
(vlax-for doc (vla-get-documents (vlax-get-acad-object))
(if (eq name (strcase (vla-get-name doc)))
(progn (setq temp doc) (exit))
)
)
)
)
temp
)
--
-Jason
Member of the Autodesk Discussion Forum Moderator Program
"Kevin Hayward" <khay...@wlbgroup.com> wrote in message
news:946CBE9F0FD32AC6...@in.WebX.maYIadrTaRb...
For instance, if a dialog box is not available or cancel is picked in a
dialog,
rather that have a long if statement to "do stuff" if everything is ok, I
will
use exit to abruptly stop with an appropriate message, usually in an alert
box.
It is all a matter of opinion, I suppose.
"Jason Piercey" <Jason@AtrEngDotCom> wrote in message
news:B51FC98AAEEDBA9A...@in.WebX.maYIadrTaRb...
--
-Jason
Member of the Autodesk Discussion Forum Moderator Program
I have no problem their use as long as there is a robust error trap and
it includes reseting the system back to its original state.
-David
Jim Claypool <jcla...@kc.rr.com> wrote in message
news:DDDDBC4C06160F8F...@in.WebX.maYIadrTaRb...
R12 - quit & exit have unique subr numbers
A2K - they are exactly the same. ( quit )
-David
Just as deeply nested ifs are a red flag...in fact any nesting of ifs at all
raises the question, why not cond instead? It will nearly always be clearer,
simpler, and easier to debug and maintain. A red flag doesn't mean *never*
do it no matter what, it just means it should alert your instincts that
there's *got* to be a better way.
A lot of autolispers seem to be real smart about the innards of Acad without
really comprehending lisp itself...more often than not, lisp functions tend
to written in an unreadable, basic-like procedural manner that denies the
elegance and simplicity that's possible in the language.
More autolispers should search out and read some of the many available
articles on programming style written by the gurus of Common Lisp. Nearly
all of this applies directly to AutoLISP. The "real" lisp people are
remarkably consistent about what is proper and good.
Jason Piercey <Jason@AtrEngDotCom> wrote in message
news:B51FC98AAEEDBA9A...@in.WebX.maYIadrTaRb...