title: Function doesn't return value to main program (Visual Studio)
body: <p>I'm new to Visual Studio and I'm trying to create a menu for my coursework, however when I call the menu function it runs but it does not return the &quot;UserChoice&quot; back into the main program.</p>
  <p>Module Coursework</p>
  <pre><code>Sub Main()
  
      Console.Title = &quot;Coursework&quot;
  
      Dim UserChoice As Integer
  
  
      Call Menu()
  
      If UserChoice = 1 Then
          Console.WriteLine(&quot;You have chosen the accuracy option. 
          Please enter the number you want to round up:&quot;)
  
          Dim NumberToRound As Long
          NumberToRound = Console.ReadLine()
  
  
          Call Menu()    ' By putting &quot;Call Menu()&quot; at the end of each choice we make a loop until the user has chosen option 5 which closes the program.
      End If
  
  
  End Sub
  
  
  Function Menu()
      Console.WriteLine(&quot;Please choose an option:
  
      1. Accuracy
      2. Quadratic equation
      3. Protein Sequence Segmentation
      4. Monte-Carlo Integration of a function
      5. Close the program                       &quot;)
  
      Dim UserChoice As Integer
      UserChoice = Console.ReadLine()
      Return UserChoice
  End Function
  </code></pre>
  <p>Anyone has any ideas why that is? Thanks in advance.</p>