TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Grrr1337 on July 17, 2016, 01:38:20 AM

Title: VLIDE - Animate only part of the code
Post by: Grrr1337 on July 17, 2016, 01:38:20 AM
Hi guys,
I'm kinda newbie when it comes about using VLIDE, and I've been reading some tutorials from Lee Mac's website, about debugging the code.
So my question is: Is it possible to animate only part of the code ?

Say I run first time the code in VLIDE, determine where did the code fail ( using "Last Break Source" ).
Then I watch the variables, and animate the code - to understand exactly why it did fail.

But the problem is:
 If the code is very long / or there are subfunctions with long loops, and I set my animation delay for 5 seconds (to analyse more carefully whats happening)
 I have to wait like 5-10 minutes, so the animation gets to my desired part, where the failure is located.
And I need exactly this... analyse only part of the code, not the whole code (because I know whats happening elsewhere, except the desired "area").
Title: Re: VLIDE - Animate only part of the code
Post by: kdub_nz on July 17, 2016, 04:13:21 AM

Perhaps :
https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2016/ENU/AutoCAD-AutoLISP/files/GUID-DA7AAC23-7198-4D29-850E-30D8BEA52008-htm.html
Title: Re: VLIDE - Animate only part of the code
Post by: Lee Mac on July 17, 2016, 12:32:48 PM
Set Break Points to pause program evaluation at the expression of interest, and then enable Animation before contuing with the evaluation - see here (http://lee-mac.com/debugvlide.html#breakpoints) for more information.


Title: Re: VLIDE - Animate only part of the code
Post by: irneb on July 18, 2016, 02:20:27 AM
Personally I never use the animate feature. I prefer going to the manual stepping instead. Placing break points (F9) where I think I would like to start "seeing execution". Thereafter it's F8 to go into the expression (e.g. if one of my own subrouties are called), Shift-F8 to step over such, Ctrl-Shift-F8 to step out of the current block and Ctrl-F8 to let it run further (e.g. until the next breakpoint). Not to mention, while you're doing this you may just notice some further code ahead - at which point you can move the cursor and place another breakpoint there - then Ctrl+F8 to run through a large loop instead of going through each of its iterations.


I just find it a LOT more efficient to control exactly when, where and how such debug steps happen, instead of attempting to "watch a movie" of my code. Also means you're not harried when you then want to check values inside of variables through the watch / inspect windows.