List all Custom Properties in a stack

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

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

Re: List all Custom Properties in a stack

Post by dunbarx » Sat Aug 06, 2022 6:04 pm

No, please team, don't listen to Craig. It would break my apps.
You know, I was just being silly. But it is obvious that changing the name of an existing long-time LC construct is never a good idea. I take it back.

Craig

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am
Location: London, UK

Re: List all Custom Properties in a stack

Post by marksmithhfx » Sun Aug 07, 2022 2:36 pm

dunbarx wrote:
Thu Aug 04, 2022 4:18 am
Mark.
how have a I lived so long without knowing about that command???
Do you mean the "combine" command? The code snippet you posted did not mention that.
Hi Craig,

No, I meant something much simpler: breakpoint.

Up until now if I wanted to interrogate what a value was at some point in my program I would do one of three things...

1. put return & something_or_other after msg
2. answer something_or_other
3. set a breakpoint

But actually putting "breakpoint" into the code? Hadn't see that before. So now I have 4 options but comparing 1 & 2 to "breakpoint" I would choose "breakpoint" 90% of the time. Since most of the code I am writing is intended to be part of a course it's nice to know where I ran into trouble, had to check something out, or was just confused. In addition to options 1 & 2, breakpoint does that (I just comment it out after). Because setting a breakpoint doesn't leave the same trail, I rarely use it. But coding a breakpoint is kind of the best of both worlds; fast and easy, and you get the full debugger environment, and it leaves a trail.

Cheers,
Mark
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

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

Re: List all Custom Properties in a stack

Post by dunbarx » Sun Aug 07, 2022 5:43 pm

3. set a breakpoint
Ah. A red dot, right?

Craig

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

Re: List all Custom Properties in a stack

Post by dunbarx » Sun Aug 07, 2022 5:52 pm

The red dots are easy to spot, which is VERY nice, and since the positional problem they had for ages has finally been solved (which was mainly why I set the explicit command) what are the pros and cons for either method these days?

Interestingly, since red dots survive sessions, I all of a sudden do not see any advantage to the actual "breakpoint" command itself, apart from its being able to be searched, which of course is significant.

Craig

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am
Location: London, UK

Re: List all Custom Properties in a stack

Post by marksmithhfx » Sun Aug 07, 2022 8:56 pm

dunbarx wrote:
Sun Aug 07, 2022 5:52 pm
The red dots are easy to spot, which is VERY nice, and since the positional problem they had for ages has finally been solved (which was mainly why I set the explicit command) what are the pros and cons for either method these days?

Interestingly, since red dots survive sessions, I all of a sudden do not see any advantage to the actual "breakpoint" command itself, apart from its being able to be searched, which of course is significant.

Craig
For me I can comment out a "breakpoint" and still have a "breadcrumb" that says "this was a tricky part to get right" (usually I am using breakpoints or their alternatives at a point in the program where the expected result is not happening!!!). When you uncheck the red dot that history is lost. Not a critical thing for every developer, but if you want to use the code as an example it's a helpful reminder of where the challenges were (also a humble reminder of just how often we screw up LoL).

A great addition to the toolkit for me.
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

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

Re: List all Custom Properties in a stack

Post by dunbarx » Mon Aug 08, 2022 2:43 am

You know, I do that as well, commenting out the command, leaving a trail to follow back. I suppose it is nice to have both tools...

Craig

stam
Posts: 2682
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: List all Custom Properties in a stack

Post by stam » Mon Aug 08, 2022 12:20 pm

Not to mention this facilitates conditional breakpoints, eg

Code: Select all

if <condition> then
   breakpoint
else
  <code>
end if 

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

Re: List all Custom Properties in a stack

Post by dunbarx » Mon Aug 08, 2022 2:33 pm

Stam.

Right.

The command takes up its own line, and the red dots sort of just lurk on an existing line. No way to substitute a dot for the command.

Very different.

Craig

speedin70
Posts: 1
Joined: Thu Sep 15, 2022 2:11 am

Re: List all Custom Properties in a stack

Post by speedin70 » Thu Sep 15, 2022 2:12 am

I use the Property Tab Builder for this. Search for it on YouTube, it's easy to set up. Not sure if that will work for a PDM setup, but it's a very easy first step to check out.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7233
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: List all Custom Properties in a stack

Post by jacque » Thu Sep 15, 2022 3:19 am

dunbarx wrote:
Mon Aug 08, 2022 2:33 pm
The command takes up its own line, and the red dots sort of just lurk on an existing line. No way to substitute a dot for the command.
For some reason I got a notification of this old thread, but now that I'm here, do you know about the conditional setting for red dot breakpoints?

You can't comment out a red dot, but you can assign a conditional to it. It's handy for temporary debugging.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

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

Re: List all Custom Properties in a stack

Post by dunbarx » Thu Sep 15, 2022 4:01 am

Jacque.

A conditional for a red dot? The dot lives "outside" of the actual text editor (the SE). How do you connect the two?

Craig

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9834
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: List all Custom Properties in a stack

Post by FourthWorld » Thu Sep 15, 2022 5:04 am

speedin70 wrote:
Thu Sep 15, 2022 2:12 am
I use the Property Tab Builder for this. Search for it on YouTube, it's easy to set up. Not sure if that will work for a PDM setup, but it's a very easy first step to check out.
Is that a LiveCode tool?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7233
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: List all Custom Properties in a stack

Post by jacque » Thu Sep 15, 2022 5:49 am

dunbarx wrote:
Thu Sep 15, 2022 4:01 am
A conditional for a red dot? The dot lives "outside" of the actual text editor (the SE). How do you connect the two?
Right-click on the dot, choose Edit from the menu. Fill out the condition you want to match. It will only break if the condition is true. You can use any valid LC syntax to create the condition.

For example, if an error occurs while parsing a long list, I might put this into the condition: tLine contains "dog". The breakpoint will only break if that is true, skipping the 500 lines before the error, and allowing me to examine the variables and execution state that led to the problem in that particular line.

The breakpoint radio button in the dialog is selected by default. There is also a Watch option which allows any occurrence of the condition to break in any script anywhere. I've had mixed results with that. If I remember right, it works best with globals.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

marksmithhfx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 931
Joined: Thu Nov 13, 2008 6:48 am
Location: London, UK

Re: List all Custom Properties in a stack

Post by marksmithhfx » Thu Sep 15, 2022 12:52 pm

jacque wrote:
Thu Sep 15, 2022 5:49 am
dunbarx wrote:
Thu Sep 15, 2022 4:01 am
A conditional for a red dot? The dot lives "outside" of the actual text editor (the SE). How do you connect the two?
Right-click on the dot, choose Edit from the menu. Fill out the condition you want to match. It will only break if the condition is true. You can use any valid LC syntax to create the condition.
I wish we could add this to the documentation for breakpoint. It's not even hinted at.
macOS 12.6.5 (Monterey), Xcode 14.2, LC 10.0.0, iOS 15.6.1
Targets: Mac, iOS

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

Re: List all Custom Properties in a stack

Post by dunbarx » Thu Sep 15, 2022 2:20 pm

Hah. Works.

The only thing about it is that there is no indication at all that a condition is assigned to a particular dot. You have to re-examine the condition right at the dot itself to know what that condition is, or that there is a condition at all. Maybe the dot should turn yellow?

Much better for me to write a line like:

Code: Select all

if it = "dog" then breakpoint
That is not startling news. Stam mentioned it explicitly above.

So I will likely never use it. No loss to the planet/

Craig

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”