title: defining and looping through arrays tcl
body: <p>I need some help in defining arrays and displaying and looping thrrough them in TCL.</p>
  
  <p>Here is how I would do them in php.</p>
  
  <pre><code>$date =array();
  $size=0;
  $date[$size] =$pre_event_date;
  /* After doing some manpulation and calculations with $size */
  for($i=0;$i&lt;=$size;$i++){
      echo $date[$i];
  }
  </code></pre>
  
  <p>I would like to do the same with tcl.Is the following code appropriate?</p>
  
  <pre><code>set size 0
  set date[$size] $pre_event_date
  #After performing some manipulation
  for {set i 0} { $i &lt;=$size } {incr i} {
      puts "$date[$i]";
  }
  </code></pre>
  
  <p>Also can I define set $date as an array. Some like like:</p>
  
  <pre><code>set date array();
  </code></pre>
  
  <p>So i edited my code tried a simple test using RSeeger's array implementation:</p>
  
  <pre><code>set date(0) 35
  set date(1)  40
  foreach key [array names date]{
     puts "${key}=$date($key)"
  }
  </code></pre>
  
  <p>the above doesnt return anything there is probably some error.
  I also tried:
  puts $date($key) without quotes but that doesnt work either.</p>