Use of the Debugger ?

simplsol at aol.com simplsol at aol.com
Thu Apr 27 15:21:54 EDT 2006


Francis,
  I wrote earlier that my experience with the Rev. Debugger was not as 
positive as Jacque's (the little red button indicating the start of the 
debugging process disappears occasionally; sometimes the marker does 
not trigger the debugger; I have to click the "Step into" button to 
begin stepping through a script - then the spacebar works as Jacque 
described it, etc.) But, even in its imperfect form, the debugger is 
extremely helpful - and, when you outgrow it, there's Jerry's 
Constellation.
  Also, please check out Geoff Canyon's Rev Navigator. It is one of the 
Plugins in the Development menu. It will not only show all of your 
buttons and fields, but it will show you what layer they occupy. AND 
you can relayer any of these objects directly (and visually) from the 
Navigator list! Got an object hidden by another object, use Navigator 
to select the hidden one. Got an object that is completely off the 
screen, use Navigator to select it then change its position back into 
view. Got two objects with the same name, on top of eachother, 
Navigator will show this. Unlike the Rev Debugger, I never have any 
"issues" with the Navigator. For over three years it has always worked 
reliably and predictably for me. I never hesitate to recommend it.
  Note, I'm not saying the Navigator replaces the debugger. Both are 
helpful (and probably "essential") tools.
 Paul Looney

 -----Original Message-----
 From: J. Landman Gay <jacque at hyperactivesw.com>
 To: How to use Revolution <use-revolution at lists.runrev.com>
 Sent: Thu, 27 Apr 2006 12:52:59 -0500
 Subject: Re: Use of the Debugger ?

 Francis Nugent Dixon wrote: 
 > Hi from Paris, 
 > > To continue after Jaqueline's and Richard's comments. 
 > > Interesting subject. Maybe we could ask other people 
 > if they use the debugger ? 
 > >> Richard Gaskin wrote: 
 >> 
 >> My first reaction is to pick my jaw up off the floor. How 
 >> can you not use the debugger much? I *live* in the 
 >> debugger! Who can program without a debugger? 
 >> You are making more work for yourself, I think. 
 > > I used HC every day for more than 10 years, and now 
 > I use Revolution every day. I never used HC debugging, 
 > and I haven't even thought about Revolution debugging ! 
 > I don't even know how it works. 
  
  I think it would be valuable for you to learn, because everything you 
describe below is done automatically for you in the debugger. 
  
 > One thing I have found very useful. I declare globals 
 > for every local, during testing, and then comment out 
 > the global definitions after testing. They will be available 
 > in the future, if I make any major mods to my scripts. 
  
  The Variable Watcher shows local variable values automatically when 
you are in debugging mode. You don't have to specially declare them or 
turn them into globals. 
  
 > I use the "do" command often, but in the form : 
 > > put xxxxxxxxxxxx into DoIt -- DoIt is a global 
 > do DoIt 
 > > Then I can see if I blew it ! 
 > > I have a header card on my stacks (which I build 
 > from pre-prepared models). I have displayglobals, 
 > displayfields and displaybuttons functions available 
 > in all my stacks, to see what I have defined. I often 
 > code "exit xxx" in my scripts during testing, and comment 
 > them out as I go. My only gripe is that the Variable Watcher 
 > doesn't update in real-time. You have to close it and 
 > open it again, each time. But then, I am just about to 
 > create a button to do this ........... ! 
  
  The VW will update automatically if you have "Script debug mode" 
turned on in the Development menu, and you are in the process of 
debugging a script. 
  
  If you are not in the process of debugging, the VW will show the 
values of all global variables. They will update in real time, but 
sometimes you need to click on them to update the display. If you are 
debugging a handler, all variables update dynamically (without 
clicking.) 
  
  Try it, I think you will be amazed at the amount of information you 
can get. Do this: 
  
  Open a script you want to debug. Make sure "Script debug mode" is 
checked in the Development menu. Click in the column to the left of any 
line in the handler where you want to see what is happening. This sets 
a red dot there, which is a breakpoint. Open the variable watcher. 
  
  Now, in your stack, do whatever action is required to run that 
handler. The place where you have put the breakpoint (the red dot) is 
where the script will stop. Look at the variable watcher -- all your 
variables are there with their current values. Use the buttons at the 
bottom of the script window to step through (or step over) each line of 
script. The variable watcher values will change. If you don't want to 
click the buttons, you can step into each line by pressing the 
spacebar. You can step over each line by pressing Shift-spacebar. 
  
  If you want to test what a different value would do to your handler, 
you can change it inside the VW while you are debugging. Click a line 
in the VW, and you will see the value of that variable in the bottom 
pane. You can change that value to whatever you want. Hit the Enter key 
to put the new value into the variable. Then continue stepping through 
your script, and it will use the new value you put in instead of the 
original value. 
  
  I sometimes use this technique to test what will happen if my stack 
encounters bad data; for example, I make a variable empty to see how my 
handler will work in that situation. Or I make a numerical value into 
an alpha value to see what will happen. It is a good way to test out 
various situations. 
  
  There is more you can do, but that's the important stuff. Try it, I 
think it will save you some time. 
  
 -- Jacqueline Landman Gay | jacque at hyperactivesw.com 
 HyperActive Software | http://www.hyperactivesw.com 
 _______________________________________________ 
 use-revolution mailing list 
 use-revolution at lists.runrev.com 
  Please visit this url to subscribe, unsubscribe and manage your 
subscription preferences: 
 http://lists.runrev.com/mailman/listinfo/use-revolution 

  



More information about the use-livecode mailing list