title: When to use CDbl and CStr functions using Visual Basic
body: <p>I'm learning to use this program. I'm a few weeks into learning it, and I'm understanding most of it fine, but I just cannot get a grasp on when to use the <code>CDbl</code>, <code>CInt</code>, <code>CStr</code>, etc. functions. Here's an example of a few lines of code I can't get a grasp of:</p>
  
  <pre><code>If IsNumeric(txtFirst.Text) And IsNumeric(txtSecond.Text) Then
    txtSum.Text = CStr(CDbl(txtFirst.Text) + CDbl(txtSecond.Text))
  </code></pre>
  
  <p>This program is supposed to take two numbers that are input by the user and add them together. Simple. I was playing around with it, and I took out the <code>CDbl</code> and <code>CStr</code> functions, and the two numbers that were supposed to be added together were only added side by side (for example, if I input 2 and 15 as my numbers it would spit out 215).</p>
  
  <p>So I'm curious when to use these functions. </p>
  
  <p>How come on the second line, it says <code>CStr(CDbl(</code>? Why would I need to convert to double, THEN to string? Which is my understanding, unless I am reading this wrong.</p>
  
  <p>Another question I have is, if I declare <code>var1</code> as <code>Dim var1 as Double</code>. I constantly see the next line as <code>var1 = CDbl(txtbox.text)</code> and so on. I don't understand why we need to convert to Double here, since when I declared the variable as a double, it should already be in a double form already, shouldn't it?</p>