title: how do i use 4 digit numbers in vb
body: <p>I need to count from <code>0 - 9999</code> in VB. How can I make the format <code>0000 - 9999</code>, so that the output is:</p>
  
  <pre><code>0000, 0001, 0002, 0003, .......
  </code></pre>
  
  <p>I used the following code </p>
  
  <pre><code>Dim p4num As Integer = 0
  Dim p3num As Integer = 0
  Dim p2num As Integer = 0
  Dim p1num As Integer = 0
  
  p4num += 1
  If p4num = 10 Then
      p4num = 0
      p3num += 1
      If p3num = 10 Then
          p3num = 0
          p2num += 1
          If p2num = 10 Then
              p2num = 0
              p1num += 1
          End If
      End If
  End If
  </code></pre>
  
  <p>but I would do it in another way. Any idea?</p>