title: Returning arrays from Procedures in TCL
body: <p>I  want to pass array and return array from a procedure, the following is the sample code i tried. But getting some errors..</p>
  
  <pre><code>set a(0) "11"
  set a(1) "10"
  set a(2) "20"
  set a(3) "30"
  set a(4) "40"
  
  proc deleten somet {
      upvar $somet myarr
      for { set i 1} { $i &lt; [array size myarr]} { incr i} {
          set arr($i) $myarr($i)
      }
      return arr
  }
  
  array set some[array get [deleten a]]
  parray some
  </code></pre>
  
  <p>when i run this code i get the following error wrong # args: should be "array set arrayName list". I'm pretty sure that i dont want to use list, how can i set the array returned from the proc to another array???</p>