 Hey everybody, this is Brian. This is video 19 in our Visual Basic Series. Today we're going to be discussing functions. So what is a function? A function is a lot like a subroutine, but it returns a value. Notice how it underlines this and says getDame does not return a value on all code paths. What does that mean? It means you have to return something. So let's just say first as string and last as string. So we're just going to combine these and say return first and last. Now this looks awfully familiar except for at the end of this we have as string. That's the value we're returning. We're returning a string. So we're just going to add the first and last name and return it. So getDame and we'll say let's pick on Bob. Bob Smith. Whoops, forgot our end quote there. Now when we run this, it prints Bob Smith. Why? Well because you see we are calling the getName function, which will execute this code, but this code has to return a value. In this case we're returning a string, which we're just literally adding the first and last name together. So let's follow along with our counter and let's make a counter as a function. So we'll say function counter as int. Oops, we forgot to. So we've got a counter as our global variable and we are going to make a counter function and this will simply say I count, oops, going to increment the counter and then we're going to return the count. That way when the sub main routine here wants to get the count, we can just call counter and notice how we're doing the console right line up here. That means we can do all sorts of manipulation in this function and just return the end product. As you can see, one, two, three is printed. So that's a function. Remember a function is like a sub routine, but it must return a value and you specify the type that it is returning. So that's our tutorial. I hope you found this educational and entertaining and thank you for watching.