Creating and Calling Simple Helper Methods - Day 1 - Part 15

Sign in to queue


As Bob has already said several times throughout Day 1, methods are simply named blocks of code. Since methods have names, you can call them by name and their code blocks will execute. This video explains when to do this, how to create and call the method, and how to both pass values into a method and retrieve values from a method.

Download the source code in c#

Download the source code in VB.Net



Download this episode

The Discussion

  • User profile image

    Very nicely done - thanks :)

  • User profile image


  • User profile image

    You really knows how to explain this stuff in a very efficient way. C# is easier than I thought, since we master the syntax everything is bread and butter. Thanks, Bob.

  • User profile image

    Nicely done...

  • User profile image

    I keep getting "Hello World, (0)" when I hit the button. What am I doing wrong? Here is my code (the video resolution isn't clear enough for me to tell if I am using the correct characters) :
    { textBlock1.Text = superSecretFormula("Bob"); } private string superSecretFormula(string myName) { return string.Format("Hello World, (0)!", myName); }

  • User profile image

    @Pairoj: It looks like you put parenthesis around your zero instead of curly brackets, which I suppose would mean the program sees the zero as nothing special. You would want your final line to be: return string.Format("Hello World, {0}!", myName);

  • User profile image
    Griffin Wiebel

    What's the program your using to record on screen?

  • User profile image

    @Griffin: I think that is Camtasia Studio.

Add Your 2 Cents