top of page

Looping with foreach in TCL

  • Admin
  • Feb 14, 2024
  • 1 min read

When you have unsorted list, foreach can be handful


set randomlist {orange blue 4 6 Türkiye 8 France cat dog}
foreach i $randomlist {
puts "i = $i"
}

 

i = orange

i = blue

i = 4

i = 6

i = Türkiye

i = 8

i = France

i = cat

i = dog

Recent Posts

See All
Spring elements in NASTRAN

In structural analysis, spring elements play a key role in simulating flexible connections, supports, joints, and contact interactions....

 
 
 

Comments

Rated 0 out of 5 stars.
No ratings yet

Add a rating

© 2023

 
bottom of page