title: To add preceding digits in a list in Tcl
body: <p>I am trying to incorporate the preceding digits in a numerical list, say 1-14, before the list 15-43.
  I am using TCL for writing my code.</p>
  <p>I am expecting the list should be 1,2,3,....43, instead the list is coming to be 15,16,17,...43.</p>
  <p>I have tried to incorporate the missing numbers as follows:</p>
  <pre><code>    set nres2 &quot;&quot;
      set x 0
      set y [lindex $nres $x]
  
      while {$x &lt; [llength $nres]} {
              set i [lindex $nres $x]
              while {$y &lt; $i} {
                      lappend nres2 $y
                      incr y
              }
              incr x
              incr y
      }
  </code></pre>
  <p>This will incorporate missing numbers within a list like, if a list 15,16,17...,43 do not have numbers like 18, 22, 34, etc., it will incorporate these numbers in a separate list named as nres2.</p>
  <p>But, I cannot include the preceding numbers of a corresponding list.
  Any comments/suggestions will be greatly helpful.</p>
  <p>Thanks in advance...
  Prathit Chatterjee</p>