Example:

set t "0.1 0.2 0.3"
set i 0;
foreach j $t {
	puts "$j is element number $i of list t"
	incr i;
}

Result:

0.1 is element number 0 of list t
0.2 is element number 1 of list t
0.3 is element number 2 of list t

Discover more from Tips and Hints for Aerospace Engineers

Subscribe now to keep reading and get access to the full archive.

Continue reading