Loop over multiple arrays simultaneously: Difference between revisions

Content added Content deleted
(Added solution for Action!)
Line 3,452: Line 3,452:
b :ARRAY{STR} := |"A", "B", "C"|;
b :ARRAY{STR} := |"A", "B", "C"|;
c :ARRAY{STR} := |"1", "2", "3"|;
c :ARRAY{STR} := |"1", "2", "3"|;
loop i ::= 0.upto!(2);
loop
#OUT + a[i] + b[i] + c[i] + "\n";
#OUT + a.elt! + b.elt! + c.elt! + "\n";
end;
end;
end;
end;
end;</lang>
end;
</lang>

If the index ''i'' is out of bounds, a runtime error is raised.


=={{header|Scala}}==
=={{header|Scala}}==