title: foreach loop - window name exists and expected boolean value error
body: <p>Morning all,</p>
  
  <p>I am running the below code</p>
  
  <pre><code>foreach rs_lb {kl15_lb din1_lb din2_lb din3_lb din4_lb \
                 dinnc_lb ain1_lb ain2_lb ain3_lb ain4_lb a_lb \
                 b_lb u_lb v_lb w_lb sin_lb cos_lb th1_lb th2_lb hvil_lb} \
  
          rs_lb_txt {KL15 DIN1 DIN2 DIN3 DIN4 DINNC AIN1 AIN2 AIN3 AIN4 \
          A B U V W SIN COS TH1 TH2 HVIL} \
  
          rs_lb_rw {0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9} \
  
          rs_lb_cm {0 0 0 0 0 0 0 0 0 0 2 2 2 2 2 2 2 2 2 2} \
  
          rs_cb {kl15_cb din1_cb din2_cb din3_cb din4_cb dinnc_cb ain1_cb \
          ain2_cb ain3_cb ain4_cb a_cb \
          b_cb u_cb v_cb w_cb sin_cb cos_cb th1_cb th2_cb hvil_cb} \
  
          rs_cb_rw {0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9} \
  
          rs_cb_cm {1 1 1 1 1 1 1 1 1 1 3 3 3 3 3 3 3 3 3 3} \
  
          ds_out_i {0 0 2 0 4 0 6 0 8 0 10 0 12 0 14 0 16 0 18 0 20 0 \
                    22 0 24 0 26 0 28 0 30 0 32 0 34 0 36 0 38 0} \
  {
      label .rs.$rs_lb -text "$rs_lb_txt"     
  
      checkbutton .rs.$rs_cb -variable $rs_cb -command {
          if {$rs_cb} {
              set ds_out($ds_out_i) 1
              set ds_out([expr $ds_out_i + 1]) 1
          } else {
              set ds_out($ds_out_i) 0
              set ds_out([expr $ds_out_i + 1]) 0
          }
      }
      grid .rs.$rs_lb -row $rs_lb_rw -column $rs_lb_cm    
      grid .rs.$rs_cb -row $rs_cb_rw -column $rs_cb_cm
  }
  </code></pre>
  
  <p>and I'm getting the error:</p>
  
  <blockquote>
    <p>window name "" already exists in parent</p>
  </blockquote>
  
  <p>and when I click on a checkbox I get the application error:</p>
  
  <blockquote>
    <p>expected boolean value but got ""
        expected boolean value but got ""
        while executing
        "if {$rs_cb} {
                set ds_out($ds_out_i) 1
                set ds_out([expr $ds_out_i + 1]) 1
                } else {
                set ds_out($ds_out_i) 0
                set ds_out([expr $ds_out_i + ..."
        invoked from within
        ".rs.u_cb invoke"
        ("uplevel" body line 1)
        invoked from within
        "uplevel #0 [list $w invoke]"
        (procedure "tk::ButtonUp" line 24)
        invoked from within
        "tk::ButtonUp .rs.u_cb"
        (command bound to event)</p>
  </blockquote>
  
  <p>Can anyone tell me why this is happening please?</p>