Search the FAQ Archives

3 - A - B - C - D - E - F - G - H - I - J - K - L - M
N - O - P - Q - R - S - T - U - V - W - X - Y - Z
faqs.org - Internet FAQ Archives

comp.cad.autocad AutoLISP FAQ (part 1/2) - general
Section - [3] How do I debug AutoLISP programs?

( Part1 - Part2 - Single Page )
[ Usenet FAQs | Web FAQs | Documents | RFC Index | Airports ]


Top Document: comp.cad.autocad AutoLISP FAQ (part 1/2) - general
Previous Document: [2] What are the best books to learn AutoLISP?
Next Document: [4] How can I protect my AutoLISP programs?
See reader questions & answers on this topic! - Help others by sharing your knowledge
[3.1] There are some native AutoLISP debuggers:

  * Visual Lisp by Autodesk and Vital Lisp Professional support
    it in the IDE (the best),
  * ACOMP for R10 had one, (free)
     you can still use it with R12 DOS, but then you've got only the R10
     LISP functions, i.e. no WCMATCH function,
  * Ld, AutoLISP Debugger for R14, R13c4 and R12/DOS from CZ,
    (free) at http://www.cadstudio.cz/ftp.htm

  See "[5] AutoLISP compilers"

[3.2] Modular style, TRACE

  The best support you can have for debugging is write your
  code in a well designed, modular style, pulling out distinct
  tasks into separate functions and then liberally using
  nested function calls. This will allow you to use the
  TRACE function as needed to locate any errors.

[3.3] You may include BREAK functions and debug-print into your source
  code.

  Examples:

  ;;; Debugging functions
  (defun break (s)
    (if *BREAK*
      (progn
        (princ "BREAK>> (stop with <Enter>)\nBREAK>> ")(princ s)
        (while (/= (setq s (getstring "\nBREAK>> ")) "")
          (print (eval (read s)))))))
  (defun dbg-print (s)  ;accepts atoms and lists
    (if *DEBUG*
      (if (listp s)
        (MAPCAR 'print s)
        (print s))))
  (defun C:DEBUG () (setq *DEBUG* (not *DEBUG*)))  ;switch it on and off
  (defun C:BREAK () (setq *BREAK* (not *BREAK*)))
  (defun CONT () (setq *BREAK* nil))    ;cont. without any interruption

  For a usage example see:
    http://xarch.tu-graz.ac.at/autocad/news/break_ex.lsp

User Contributions:

Comment about this article, ask questions, or add new information about this topic:

CAPTCHA




Top Document: comp.cad.autocad AutoLISP FAQ (part 1/2) - general
Previous Document: [2] What are the best books to learn AutoLISP?
Next Document: [4] How can I protect my AutoLISP programs?

Part1 - Part2 - Single Page

[ Usenet FAQs | Web FAQs | Documents | RFC Index ]

Send corrections/additions to the FAQ Maintainer:
rurban@xarch.tu-graz.ac.at (Reini Urban)





Last Update March 27 2014 @ 02:11 PM