Page 1 of 1

Is there a "where used" function in the Debugger?

Posted: Fri Jun 29, 2018 3:58 pm
by mluka
Hi all.

Is there a function that would allow one to discover all the places (in a stack) where a handler is called?

(Context: I'm trying to get my head around the DataGrid before making a final decision on using LC to replace some dying apps on my iPhone and FileMaker Pro on my iMac. In one of the lessons ("Creating a List of People"), it is disclosed that the "behaviour" script of the DG contains a handler, "FillInData", which seems to play an important role. But I could not find where or when or why it's called from... I put a checkpoint on that handler and it was triggered when I scrolled the DG (in user mode) to the top. But it does not tell me who called it!!!)

(A note: the LC 9.0.0 User Guide mentions (p. 498) that there is a Debug Context that "shows you the path of execution..." I must be blind, because I can't find such a thing, either in the window that opens when the breakpoint is triggered or in the menus...)

Thanks.

Re: Is there a "where used" function in the Debugger?

Posted: Fri Jun 29, 2018 4:27 pm
by LiveCode_Panos
Hi mluka,

To show all the occurrences of a handler:

You can open the script editor, press cmd+F to show the Search Bar, and then click on "More".

In the dialog that appears now, enter your search term and in the dropdown "Look in" choose "all available stacks", and then click on "find all".

Moreover, if you want the search to include IDE stacks as well, make sure you have checked the "Show IDE stacks in Lists" (in the LC menubar choose View -> "Show IDE stacks in Lists")

Best,
Panos
--

Re: Is there a "where used" function in the Debugger?

Posted: Fri Jun 29, 2018 6:53 pm
by dunbarx
Hi.

I think you are wanting the "Find and "Replace..." menuItem in the "Edit" menu.

This is powerful and invaluable, and after you play around with its options, you will be on your way.

Craig Newman

Re: Is there a "where used" function in the Debugger?

Posted: Fri Jun 29, 2018 7:24 pm
by mluka
Yes! The "Find"! Thanks for the answer!

But... "be careful what you ask for..."

Unfortunately, for my specific problem, there are 52 occurences!!! Some of which evidently come from deeply inside the DataGrid internals!

I'm not going to learn how to use the DataGrid by using this approach. :?

Please bear with me: I'll post another question, in more general terms, later. I think I may have chewed off more than I can handle... :cry:

Thanks for all your help so far!

Re: Is there a "where used" function in the Debugger?

Posted: Fri Jun 29, 2018 8:21 pm
by dunbarx
You may have to get creative. There is an option to search only the current card. If you make a copy of that card, and delete the dataGrid, you can then see only the handlers (or any string) of interest outside that gadget.

Craig