title: VB : If variable is anything else?
body: <p>I'm just learning Visual Basic. I tried to make a calculator but I want it so if you anything else that isn't in the if statement thing it says "Sorry" and returns to the beginning. Here's the code:</p>
  
  <pre><code>Module Module1
  
    Sub Main()
      Dim num1 As Integer
      Dim num2 As Integer
      Dim op As String
      Console.WriteLine("Calculator")
      Console.WriteLine(" ")
      Console.WriteLine("Valid Operators :")
      Console.WriteLine("+(Addition), -(Subtraction), *(Multiplication) &amp; /(Division)")
      Console.WriteLine(" ")
      Console.WriteLine("Enter Number 1 :")
      num1 = Console.ReadLine()
      Console.WriteLine(" ")
      Console.WriteLine("Enter Number 2 :")
      num2 = Console.ReadLine()
      Console.WriteLine(" ")
      Console.WriteLine("Enter Operator :")
      op = Console.ReadLine()
      If op = "+" Then
          Console.WriteLine(" ")
          Console.WriteLine("Answer :")
          Console.WriteLine(num1 + num2)
          Console.WriteLine(" ")
          Console.WriteLine("Press &lt;Enter&gt; To Exit")
          Console.ReadLine()
      End If
      If op = "-" Then
          Console.WriteLine(" ")
          Console.WriteLine("Answer :")
          Console.WriteLine(num1 - num2)
          Console.WriteLine(" ")
          Console.WriteLine("Press &lt;Enter&gt; To Exit")
          Console.ReadLine()
      End If
      If op = "*" Then
          Console.WriteLine(" ")
          Console.WriteLine("Answer :")
          Console.WriteLine(num1 * num2)
          Console.WriteLine(" ")
          Console.WriteLine("Press &lt;Enter&gt; To Exit")
          Console.ReadLine()
      End If
      If op = "/" Then
          Console.WriteLine(" ")
          Console.WriteLine("Answer :")
          Console.WriteLine(num1 / num2)
          Console.WriteLine(" ")
          Console.WriteLine("Press &lt;Enter&gt; To Exit")
          Console.ReadLine()
      End If
      If op = Nothing Then
          Console.WriteLine(" ")
          Console.WriteLine("You have not entered a valid operator.")
          Console.WriteLine(" ")
          Console.WriteLine("Press &lt;Enter&gt; To Exit")
          Console.ReadLine()
      End If
  
    End Sub
  
  End Module
  </code></pre>
  
  <p>Can Anyone Help?</p>