The title of this video is debugging demo. In this video, I want to show different method of looking at data that's within your code. Really a big part of debugging your code is understanding what is being held within variables in the list and ultimately the dictionaries, and understanding how that's being moved around within the code. Because typically, your bug probably has something to do with the data not being moved around correctly or exchanged or taken from functions in a correct way. Actually, looking at the data itself is a really important part of debugging. Now, in debugging light and up to this point in the course, we've, of course, been using the print function. That's really a primary way that I do a lot of my debugging is printing out what's being held within a variable. I like to use it because it gives me a localized control over seeing that data. But there is another way to see the data that's being held within the code, and that's to use a toggle breakpoint or a little button within the code that stops the code at that point that you've put the breakpoint, and it'll show you all the data that's held in the code up to that point. You can put a bunch of these toggled breakpoints in your code. I'm going to demonstrate that using a simple code that we used in Lesson 2 to our attractor point code. If I run it, just select an attractor point, and that's going to create matrices and our variable circles. With this, I'm looping through the point list and I'm printing out the i, and I'm printing out the current point in the point list. We can see that down here. I'm also printing out a distance that's being measured between the attractor point and the points within a pointless, current point within a pointless, and then, of course, I'm creating the circles. That's, again, still very valid way of understanding the data that's being held. So I'm going to put a toggle breakpoint in here, and something about putting that, you have to put it in an active line. It's going to stop the code on that line. It's not going to run that line and I can't put it in. If I try to click where I have a comment, it's not going to allow me to put it in. If I try to click where I don't have any line of code, I can't put it there. So it has to be on this active line. If I'm using it often I'll just create a simple print line of code as a place to be able to stop the code, to run this toggle breakpoint. Let's go ahead and run that. Select your attractor point, I'm not going to worry about that. It runs the code and then it opens the editor. It essentially frozen the code at this point in the running, and it shows me all of my data that I have held within my variables right at that point. It's showing me some other information too which I might not follow or understand. It's a background information. It's actually showing me the RhinoScriptSyntax as a module that I've input. The column on the left is the variable name or list name or dictionary name if I'm using them. The middle column is the value that's being held within that list or variable, and then it's showing me the datatype on the right-hand side. It's actually a very useful tool for starting to understand what's being held within a code when it runs. For example, if I look at this point list, this list right here, if I'm running through this loop and I'm saving all my points in this thing called point list. That part of the code is complete. Now it goes to this next loop and it's going to run one, just the first time through that loop, then it's stops the program right there. It's holding all the data in that point list. I opened this up, it's showing me that it's index structure starting at zero, and in each one of those, it's holding a tuple of three items. Those three items are also indexically organized, I can see here. The values that are being held, this is my x, y, z, my points, the first point is 0, 0, 0. This is the second point, the second point is 0, 1, 0. Third point is 0, 2, 0, and so on. I'm viewing here that structure of the tuples embedded within this point list. It's a really handy way for seeing that structure. These other variables here; i, j, x, y, z, this is showing me the last value that's being held in each of those. So j, x, and y, the last value from this loop was nine because they were kicked out of the loop when I got to 10. You might ask, "Well, why is i", i is up here, "why is i is zero?" Well, i is zero because I used i again in this loop here. It went back to zero because that was the most recent assignment for i. Then I can hit "Play" again here, it would finish my code. It's just looping through it again. If I want to finish it, I can do clear all breakpoints and then just hit "Play". I can take that out. Now, if I wanted to I could add multiple breakpoints. I could add one here and one, let's say, here. Run it again, select my attractor point. Now it halts at that first. Shows me this little yellow arrow, shows me where it stopping. If I run it a bit more, actually, only additional variable it's going to show me because it's going to stop right here, is this my first distance value. But we could see that. If I hit "Play" again, then it jumps to the next one. It runs like this bit of code and then it stops, and it's showing me that distance value right here. So if I had more complicated code, you could see how this could be very handy if I had a bunch of breakpoints, and I wanted to run and really analyze and take a look at the data that's being held within the code. Again, I prefer to use print and your free to use a combination of both. But it is a very handy way if you want to play around with it for understanding this structure of variables and data, and data types within the code.