Go ahead and use repeat loops--it's tough to do much >programming without them. Just step through them in your head, and the >debugger, so you fully understand what they are doing. > >You are using the debugger, aren't you?
I�m trying to. >>on mouseUp me >>global gMoveAmt >>set myIndex = 1 >>repeat while not the mouseDown >>setMoveAmt = setAt (gMoveAmt, myIndex) >>set myIndex = myIndex +1 >>if myIndex > 100 then exit repeat >>end repeat >>end > >That's a repeat loop. Not optimum, but better than the first. May I know where my mistake lies? So that I may learn to write better code? Is it because I am using globals? I also notice that the code people hand out here usually uses p = property to describe ? >>1. What is the meaning of [:] ? I notice it is used in >>getPropertyDescriptionLists. > >That declares an empty property list. The purpose of declaring an empty property list is to add items to the list. You didn�t do that, you just defined it immediately? Is there any difference? >>2. What I originally wrote in the last post (repeat with sprNum and >>LocH) is an example of a performance issue in Director? > >Yes--a very good example of a way to bring Director to its knees. So, I need to optimize lingo performance by writing �better� code? >Set a break point in your original loop--the one I said was inefficient. >Step through it in the debugger and see how nested loops work. That's a lot >better than my trying to explain in an e-mail. > Aren�t you a killjoy? A nested loop is written in this way: First there is a loop, then you have another loop within this loop. Normally, you should exit the inner loop first then you exit the outer loop. Is this correct? >Oh, did I mention that the debugger is a great way to learn how code works? Yes, you did. Including this final sentence, you have mentioned it a grand total of six times in this message. Yes, I do understand the importance of the debugger. Use it as often as possible and frustrate / disturb / confound a certain person by the name of Kerry Thompson less. Thanks very much Genevieve I do apologize for any rudeness on my part. _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp [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!]
