Looking for debugging tips

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
gg12
Posts: 6
Joined: Mon May 02, 2022 1:49 am

Looking for debugging tips

Post by gg12 » Thu Jun 02, 2022 2:54 pm

Hi,
I'm looking for tips for debugging.
I use single breakpoint then I launch my app, it stops and I check the variables without problems.
However when there are loops, it's a bit harder to keep up, I put at the last line of the loop:

Code: Select all

wait while the commandkey is up
wait 48 
I feel like it doesn't show the variables evolutions.
Do you have better tips for debugging? / More efficient ways? / How do you like to debug? / Do you have the golden steps for debugging?

Thanks in advance, gg

Klaus
Posts: 13865
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Looking for debugging tips

Post by Klaus » Thu Jun 02, 2022 3:04 pm

Hi gg12,

welcome to the forum!

I can recommend these stacke to learn more about the LC basics.
There is also a stack devoted to "Debugging", that may help.
http://www.hyperactivesw.com/revscriptc ... ences.html

Best

Klaus

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9751
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Looking for debugging tips

Post by dunbarx » Thu Jun 02, 2022 7:04 pm

Hi.

If you set a breakpoint in a loop, you will see the values of all variables at that point. Then you must either step through each line or "run" the code until the next pass through the loop, where execution will stop again, and you can examine the variables once more.

Do you know how to use the debugger that way?

This is standard procedure, and can be tedious, depending on how the loop is built. Know also that you can set a "watchPoint" instead of a breakpoint, which will stop execution based on the values of variables, so you only need to look at the loop when certain criteria are met.

Craig

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”