MJLM Posted January 12, 2022 Share Posted January 12, 2022 Hello. Can somebody tell me whether the visual lisp debugger supports braking based on a conditional criterion? Say I want to break when the counter of a loop running reaches the nth iteration. Thanks Quote Link to comment Share on other sites More sharing options...
mhupp Posted January 12, 2022 Share Posted January 12, 2022 (edited) You could build it into your lisp. (setq i 0) (setq rep "Yes") (while (eq rep "Yes") ;code you want to loop (setq i (1+ i)) (if (> i 500) ;check to continue every 500 loops (progn (setq i 0) (initget "Yes No") (setq rep (cond ((getkword "\nContinue? [Yes/No]: ")) ( "Yes") ) ) ) ) ) Edited January 12, 2022 by mhupp Quote Link to comment Share on other sites More sharing options...
MJLM Posted January 12, 2022 Author Share Posted January 12, 2022 Thanks but I want the debugger to let me continue with inspection of the code while running by using (shift+) F8, animate etc... I guess this is not really an option with VL IDE like for instance Visual studio, right? Quote Link to comment Share on other sites More sharing options...
mhupp Posted January 12, 2022 Share Posted January 12, 2022 IDK use BricsCAD Quote Link to comment Share on other sites More sharing options...
Stefan BMR Posted January 12, 2022 Share Posted January 12, 2022 Take a look at this code. Click on the end of the indicated lines, next to the last ")" then press F9 to set the breakpoint. Then run the code and when it stops, press ctrl+F8 to continue. (setq i 1 s 0) (while (<= i 20) (setq s (+ s i)) (setq i (1+ i)) (cond ((= i 10) (princ "\nFirst stop");<-- Breakpoint ) ((= i 15) (princ "\nSecond stop");<-- Breakpoint ) ) ) Following all steps above, this is what I got on the console 0 First stop _1_$ Second stop _1_$ nil _$ i s 21 210 _$ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.