Debugging Help

Jim Ault JimAultWins at yahoo.com
Wed Feb 27 11:19:33 EST 2008


On 2/27/08 7:27 AM, "Len Morgan" <len-morgan at crcom.net> wrote:

> I'm having trouble chasing down a problem: I have a field that is
> getting cleared as soon as you tab out of it.  I can't seem to locate
> where in the message path this is happening.  This SPECIFIC problem is
> mine to solve (punishment for a less than organized development approach).
> 
> What I'm wondering is if there is a way to show the path a message would
> take through the message heirarchy.  In other words is there some way I
> could send an exitField (or closeField) message to a specific field and
> then get some sort of listing of the path that message would take?  In
> other words, is there some way to simulate the "traceroute" command used
> in networking to the message path?
> 
> The other debugging chore I'd like to have is a stack compare function.
> Would it be difficult to create a function that would take two stack
> names as arguments and then display in two side by side panes the
> differences between them?  Not just scripts but objects, properties,
> etc?  I'm thinking of something like the interface that the
> "BeyondCompare" program (used to compare text files).
> 
> Anyway, any suggestions would be appreciated.

You could do this:


on buildTRoute
global gTracerHandler
--  build script
get "on tracePing pingText" & cr
get it & "global gTraceRouteReport" & cr
get it & " put the long id of me & cr & pingText & cr after
gTraceRouteReport" & cr

get it & " pass tracePing pingText" & cr
get it & " end tracePing "
--end building script
put it into gTracerHandler
-- the handler is ready to be installed in all containers

--now do the controls on the current card
--  we store the original script in a custom property in the same control,
card, or stack
repeat for x = 1 to the number of controls
put the script of control x into orig
set the origScriptOfMe of control x to orig
set the script of control x to orig & cr & tracerHandler

end repeat
--now do the stack and card scripts
put the script of this stack into orig
set the origScriptOfMe of this stack to orig
set the script of this stack to orig & cr & tracerHandler

put the script of this card into orig
set the origScriptOfMe of this card to orig
set the script of this card to orig & cr & tracerHandler

end buildTRoute

--of course you don't need to store and restore the original scripts, just
make a copy of the stack.  If you do need to restore, then
set the script of control x to the origScriptOfMe of control x


Jim Ault
Las Vegas





More information about the use-livecode mailing list