 Hey everybody this is Brian and this is video 13 in our visual basic tutorial. We're going to continue with arrays and I want to show you what happens if another one comes in. Remember we use the dinner analogy where the array is the table and each item on here is a plate. And we added an item which throws an error. Let's just demonstrate that real quick. There's our index out of bounds error. Well let's say Bob shows up in the middle of dinner with a knowing Bob and he always wants to show up while eating dinner so he can eat dinner with us. Well what we need to do is add another plate to this array after it already exists. So we will redim the array plate 4. Now what we are doing is we are re-declaring the array as four slots. That adds a fourth index here actually a fifth item but at index 4 you understand what I mean. When we run this now we no longer have an error and it works. But you notice all the values are zero. Why is that? Well what redim does is create a blank array and adds to it. If you want to keep the existing values you have to preserve them. So there's redim preserve and then you give it the array with the number of items. And that will keep everybody's dinner set and ready to go. So now you can run it and see that their number of carrots on their plate has not changed. So that is how you resize an array. Now what is actually happening in the background here is the .NET framework is actually creating a brand new array and sizing it to the new size you give it. And you see that when you get rid of the preserve statement and you run this and they are all zero. It is because the array is blank it has no data in it. The preserve statement copies the array. It copies the old array into the new array. That way all of your values go with it. It's much much faster than doing an array.copy which we may or may not cover in another tutorial. But I wanted to show you that because I've gotten questions in the past from people of okay you have an array you want to resize it how do you do that. So I hope that answers that question. Well this is Brian and I hope you found this video educational and entertaining and thank you for watching.