Loop over multiple arrays simultaneously: Difference between revisions

(Added solution for Action!)
Line 3,452:
b :ARRAY{STR} := |"A", "B", "C"|;
c :ARRAY{STR} := |"1", "2", "3"|;
loop i ::= 0.upto!(2);
#OUT + a[i].elt! + b[i].elt! + c[i].elt! + "\n";
end;
end;
end;</lang>
</lang>
 
If the index ''i'' is out of bounds, a runtime error is raised.
 
=={{header|Scala}}==
Anonymous user