Loop over multiple arrays simultaneously: Difference between revisions

Content deleted Content added
Added an Algol W sample
Line 67:
</pre>
 
=={{header|ALGOL W}}==
<lang algolw>begin
% declare the three arrays %
string(1) array a, b ( 1 :: 3 );
integer array c ( 1 :: 3 );
% initialise the arrays - have to do this element by element in Algol W %
a(1) := "A"; a(2) := "B"; a(3) := "C";
b(1) := "a"; b(2) := "b"; b(3) := "c";
c(1) := 1; c(2) := 2; c(3) := 3;
% loop over the arrays %
for i := 1 until 3 do write( i_w := 1, s_w := 0, a(i), b(i), c(i) );
end. </lang>
 
If the arrays are not the same length, a subscript range error would occur when a non-existant element was accessed.
=={{header|AutoHotkey}}==
=== Pseudo-arrays ===