title: TryParse and Variables
body: <p>I am just learning C# and I am trying to learn more about TryParse and how it relates to and interacts with established variables. In the following example I'm simply confirming whether the values in a text box are indeed decimals and that they fall within a given range. Otherwise, I call the BadInput() method which displays an error message. </p>
  
  <pre><code>private void VerifyNums()
      {
          if (decimal.TryParse(Val1Box.Text, out Val1)&amp;&amp; (val1&lt;=100) &amp;&amp; (Val1&gt;=0))
          {
              if (decimal.TryParse(Val2Box.Text, out Val2) &amp;&amp; (Val2 &lt;=100) &amp;&amp; (Val2 &gt;=0))
              {
                  if (decimal.TryParse(Val3.Text, out Val3) &amp;&amp; (Val3 &lt;100) &amp;&amp; (Val3 &gt;=0))
                  {
                      GoodInput();
                  }
                  else
                  {
                      BadInput();
                  }
              }
              else
              {
                  BadInput();
              }
          }
          else
          {
              BadInput();
          }
      }
  </code></pre>
  
  <p>First Question: What does OUT do in a TryParse? Does it set Val1 equal to the contents of the text box? </p>
  
  <p>Second Question: Is it possible to Parse and check the variables Val1, Val2 and Val3 and then be able to use them as input or arguments in other methods? If so, how is that done? I have read a lot about OUT and REF I just don't understand how they work.  </p>