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