Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Do a loop over all elements of the objarray, on each iteration set the value of <variable_name> to the i-value and evaluate the script of the body, similar to a for or a foreach Tcl command.

A break command in the body exit the loop

e.g.

Code Block
set obj [objarray new intarray -values {5 6 7 8}] 
-> 5 6 7 8 
objarray foreach x $obj {
   puts "x=$x"
}
-> 
x=5
x=6
x=7
x=8