mtettmar wrote:jpuziano wrote:I read the "Using the Debugger" topic in the Help File but I didn't see anything about having to set a breakpoint to see the variables in the watch list if using "Run". I just assumed you could only see them if "Stepping" through one line at a time. Thanks for these pointers.
Erm, yes, you only see the variables when you step. If you set a breakpoint and run to it, you are then left in step mode. Run to breakpoint, it then sits there waiting for you to continue stepping, or stop. So it's in step mode. Run to breakpoint runs to breakpoint and puts it in step mode. Not sure what else it would do, so to me this is self explanatory. If you run without a breakpoint or without stepping then you run to the end and the variables are no longer.
Except for scripts that don't naturally "run to the end" like JRL's example scripts from earlier in this post which will run forever waiting for the user to hit a key. Step mode isn't suited to debug OnEvent> commands (event handlers) because in step mode, the macro only runs for a brief instant right after you press F8 (or click "Debug Step F8" toolbar button). You can't really press + or = fast enough to see how the event handlers might respond so... the only way to use the debugger to test this script was to click Run. So I did, its running, I can hit keys to see how the event handlers respond but I noticed the Watch List was blank. Note that normally I've always stepped through a macro so I'm used to seeing the Watch List populated. I know now the thing to do is insert a breakpoint, perhaps in the event handler's SRT> code and when execution reaches the breakpoint, it will pop into Step mode and then I can see the state of the variables. In v9 after it hits the breakpoint, I can only Step from then on. I actually wanted to just continue running but couldn't. I see in v10, you now have...
Enhanced debugger - multiple breakpoints, step, then run.
...which is great, I'll have to try that out.
mtettmar wrote:Run to breakpoint means it runs to that point, stops and then waits for you to step. It puts it in debug mode, step mode. So the watch list will show the variables.
You used the phrase "run to breakpoint" three times in your reply but on searching, that phrase doesn't appear in either the "Using the Debugger" help topic or the
Use the Debugger! blog post.
v9 Help text says:
- Insert Breakpoint
Inserts a breakpoint after the selected line. Simply inserts **BREAKPOINT** on the next line. If running the script using 'Run' from the Debug menu, execution will pause when this Breakpoint line is reached and the script can then be stepped from this point.
but could say this instead:
- Insert Breakpoint
Inserts a breakpoint after the selected line. Simply inserts **BREAKPOINT** on the next line. If running the script using 'Run' from the Debug menu, execution will pause when this Breakpoint line is reached, Watch List variables will be shown and the script can then be stepped from this point.
Also, in v9, you have three toolbar buttons in a row with the following tooltip text:
Code: Select all
Debug Step (F8)
Stop Debug (Ctrl+F2)
Run
Why just Run? The other two contain "Debug", why not one of these?
Code: Select all
Run Debug
Debug Run
Debug Run until Breakpoint
Just changing that tooltip text could serve as a reminder to users that always click that button to test their scripts that they actually have a Debugger at their disposal, not just an Editor and encourage them to explore its features.
mtettmar wrote:jpuziano wrote:If you're looking for another topic for your Blog or even better, the video demos you sometimes make, then I think "Using the Debugger" would make a great topic. Besides helping the users, it might even cut down on support questions eventually as users would more easily find their own problems if they knew their way around the Debugger.
Well, granted there's no video to go with it, but this article has been there since May 2006:
http://www.mjtnet.com/blog/2006/05/17/use-the-debugger/
Good blog post, however:
- Is there any info in that post that isn't in the Help File?
- Users will hopefully read the Help File when trying to learn the debugger but they may never find that blog post. Adding a link to it in the Help File "Using the Debugger" topic would make it more findable.
mtettmar wrote:As for support requests, that is precisely the reason the above page is linked to right above the main support contact form:
http://www.mjtnet.com/contact.htm
Where it says: "Finally, if you're emailing for help with a script problem, have you debugged it yet?"
I've also linked to that article here in the forums when I've suggested someone use the debugger.
The debugger is frighteningly easy to use. Press F8 and see what happens and it should all become clear. Set a breakpoint and see what happens. There's not much more to it. Does that really warrant a video?
Well, you start off your blog post with...
- "The first thing I turn to when helping someone get their script working is the debugger. But I’m often surprised to hear people say they didn’t know about the debugger."
...so I'd say that yes there is an issue. To
increase the visibility of the Debugger, you could:
- change the tooltip text from "Run" to "Debug Run until Breakpoint" or other choices as mentioned above
- change the window title from Editor to "Editor/Debugger"
- in Main screen File menu and right-click menu, menu item just says "Edit Script", why not "Edit/Debug Script"
- I say a video because some users who won't read through a page of text to learn something new... will actually watch a video to learn how something works. It takes them by the hand, they don't need to visualize, they can just watch.
Note that none of the above is meant as criticism, just feedback and opinions... take care.