Code: Select all
r := "arbsctdu" ; i.e. abcd interwoven with rstu
ar := [[1][2]] ; 2-dimensional array creation
i = 1
j = 0 ; as toggle
loop, parse, r ; 1-char-by-1
{
if j = 0
{
j = 1 ; for next iteration
ar[[i][1]] := a_loopfield
}
else ; j = 1
{
; i++ ; at next iteration
j = 0
ar[[i][2]] := a_loopfield
++i ; for next iteration
}
}
a1 := ar[[1][1]]
a2 := ar[[2][1]]
a3 := ar[[3][1]]
a4 := ar[[4][1]]
b1 := ar[[1][2]]
b2 := ar[[2][2]]
b3 := ar[[3][2]]
b4 := ar[[4][2]]
msgbox, %a1%>%b1%`t%a2%>%b2%`t%a3%>%b3%`t%a4%>%b4%`n
; expected: a>r b>s c>t d>u, NOT: a>u b>u c>u d>u
and I invariably get a>u b>u c>u d>u
instead of a>r b>s c>t d>u
Why?