Thanx for clearing that up Irv,

I was stepping through the code as you mention, the var was 4 not using
the debugger and 0 when using it, not VOID as it would be if the
variable is unassigned. I guess I got your "Heisenberg Uncertainty
Principle of Debugging" the first time I attempted to use the debugger
:o( its been ok ever since.

JamieD

> A couple of comments.
> 
> Please read my article on DOUG about the debugger:
> 
>     http://www.director-online.com/accessArticle.cfm?id=871
> 
> As I say in the article mentioned above, if you are not using the 
> debugger, you are just wasting your time.
> 
> Jakob is correct here that you should use "the currentSpriteNum" or 
> even just "spriteNum" to get the channel number of the current 
> sprite.  In the code you are showing, you are taking a sprite 
> reference, and then taking an integer function of that - definitely 
> not what you really want to do.
> 
> Also, when you put a breakpoint on a line of code, the debugger stops 
> execution of Lingo BEFORE that line is executed.  If you want to see 
> the results of what happened in a line of code, you must "step" (the 
> first of the three green buttons), then look at your variables. 
> Alternatively, put your breakpoint on the line after the line in 
> question.
> 
> 
> As an aside, 99.999%  of the time, using the debugger will not make 
> your code behave differently.  It is just a tool that allows you to 
> analyze what is going on in your program.  In the odd .001% of the 
> time, the use of the debugger somehow changes the environment.  For 
> years now, I've been calling this the "Heisenberg Uncertainty 
> Principle of Debugging".  (Check your Phsics books for obscure 
> references ...)
> 
> Irv
> 
> 
> At 10:56 AM +0000 10/30/01, Jamie Dyer wrote:
> >Hi,
> >
> >Has anyone else encountered this problem?
> >I have a movie thats on the brink of working propperly but 
> needs a bit
> >of debugging. I have set a breakpoint on this line of code:
> >
> >Snum = (sprite(the currentSpriteNum)).integer
> >
> >when I dont use a break point and use a put Snum then I get 
> a value of 1
> >or over depening on which channel the sprite in on. When I 
> set the break
> >point then Sum has a value of 0 all the time, even if I 
> issue a put Snum
> >it still returns as 0. There is no difference in the script at all,
> >apart from the breakpoint. Returning the sprite number as 0 breaks my
> >movie.
> >
> >Is this some strange bug in director, or am I using the debugger
> >incorrectly? I have never used the debugger before, I have always
> >debugged my code by using put commands. But now I find its a 
> little to
> >complex to correct using put.
> >
> >Also, using the watcher, can you only watch global vars? I 
> dont seam to
> >be able to watch local ones.
> >
> >I have searched through the help files, macromedia website, 
> and searched
> >google to no avail, there is little, if any, documentation 
> at all on the
> >debugger.
> 
> 
> -- 
> 
> Lingo / Director / Shockwave development for all occasions. 
>           
>    (Home-made Lingo cooked up fresh every day just for you.)
> 
> [To remove yourself from this list, or to change to digest mode, go to
> http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
> email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
> Lingo-L is for learning and helping with programming Lingo.  Thanks!]
> 
> 

[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to