Finding where code is executed

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

Post Reply
yachris
Posts: 20
Joined: Sat May 21, 2011 1:26 am

Finding where code is executed

Post by yachris » Fri May 27, 2011 1:22 pm

Hello,

I have a specific problem, to which I'd much appreciate a general solution.

What happened is this: I'm working on a stack, and it's (mostly!) going well. I added a group of controls from an open-source stack to my stack, and it works. However, at one point, there was a "visual effect push right" which I changed to "visual effect push left". Fine, it pushes the way I want it to... but too slowly for my tastes. I'd like to make it "visual effect push left fast".

And... I can't find that code again. Anywhere! I've checked the button itself in the group, the group the button is a member of, the group that group is a member of, my card, my stack... The "push left" still happens, so it must be somewhere, right? In fact, I'm sure it does; I thought maybe I'd removed it and it was somehow kept as some kind of default; but when I added another "push left" to the "on mouseUp" where the behavior happens, I got two pushes! Entertaining :-) but not what I want.

So that's the specific problem.

In general, I'd like to be able to figure out what's going on with my code. Well, for *my* code, this shouldn't be a problem (sure :-) ), but for code added from somewhere else (ENORMOUS THANKS TO ALL GENEROUS CONTRIBUTORS, of course!) it can be kind of confusing.

For the record, I have done a bit of research into the whole Message Hierarchy, and downloaded the fantastic stack that goes over it, and includes the GetMessagePath() function (which I tried, it didn't find anything new).

I feel a bit like I did with my early days of Object-Oriented programming... mysterious code is executed (due to inheritance, say, in OO land) and I can't find it or track it down.

SO: Specific questions.

Is there a way to debug the *WHOLE* message trace, from beginning to end? (Hmmmm, I'll have to try adding a FrontScript and debug from there...)

Is there a way to dump the script text of everything in a stack, so I can use ordinary text editors, etc., on it?

Any better ideas?

Thanks!

Regulae
Posts: 136
Joined: Tue Oct 20, 2009 6:05 am

Re: Finding where code is executed

Post by Regulae » Fri May 27, 2011 1:32 pm

Hi there,

In another thread, a useful tool called "Script Reporter" was mentioned, which may be worth a look:
http://forums.runrev.com/phpBB2/viewtop ... ter#p35759

Regards,

Michael

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: Finding where code is executed

Post by bn » Fri May 27, 2011 1:49 pm

Hi yachris,

Script reporter is a very nice tool.

You also might have a look at the built-in Find and Replace.
Command-F or from the Edit menu.

There you select what you want to search (card, stack, all stacks) and click "script"

Type your search and let is search. If it finds something it will list the objects that contain your search. (you might have to resize the stack)

Double clicking on a hit takes you to the script.

The stack looks a bit 'old' but is very handy to use.

Kind regards

Bernd

yachris
Posts: 20
Joined: Sat May 21, 2011 1:26 am

Re: Finding where code is executed

Post by yachris » Fri May 27, 2011 1:53 pm

Wow, thanks for the great suggestions, in record time! Much appreciated.

Turned out the code was in a custom property of the control????? That truly earns five question marks. I think I'll email the author and ask about that... probably intended as a customization system, but it's a little obscure.

Oh, and I did find it by putting a Front Script on, and started debugging there. Learned that you REALLY don't want to use "answer" in a front script... had to Force Quit LiveCode twice :-)

And... alas, Script Reporter doesn't find code in custom properties.

BvG
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1239
Joined: Sat Apr 08, 2006 1:10 pm
Contact:

Re: Finding where code is executed

Post by BvG » Fri May 27, 2011 3:21 pm

code in cprops is not used. that is by default that code would be ignored. however one can use any text as code using "do" so most likely, somewhere in the code there's "do" statements, which then point to those customproperties.
note that there's weird, for historical reason existing, limitations on "do" statements outside the ide. (see "scriptLimits" in the dictionary).
Various teststacks and stuff:
http://bjoernke.com

Chat with other RunRev developers:
chat.freenode.net:6666 #livecode

Post Reply