I am starting at 1, ignoring 0
I have since written a simple version with arrays of [10,2] and dim as String with the same data in each array... AND IT WORKS!
I have even copied the data from the first array in reverse order into the second array and carried out the same test checking that array1[any,1] can find array2[any,2] and it still works fine!
Dim Array1[10,2] as String
Dim Array2[10,2] as String
Array1[1,1] = "ONE"
Array1[1,2] = "ONE"
Array1[2,1] = "TWO"
Array1[2,2] = "TWO"
Array1[3,1] = "THREE"
Array1[3,2] = "THREE"
Array1[4,1] = "FOUR"
Array1[4,2] = "FOUR"
Array1[5,1] = "FIVE"
Array1[5,2] = "FIVE"
Array1[6,1] = "SIX"
Array1[6,2] = "SIX"
Array1[7,1] = "SEVEN"
Array1[7,2] = "SEVEN"
Array1[8,1] = "EIGHT"
Array1[8,2] = "EIGHT"
Array1[9,1] = "NINE"
Array1[9,2] = "NINE"
Array1[10,1] = "TEN"
Array1[10,2] = "TEN"
For r = 1 to 10
Array2[11-r,1] = Array1[r,1]
Array2[11-r,2] = Array1[r,2]
Next
viewCurrent = 1
do
if getRawKeyPressed(37)>0
dec viewCurrent
gosub getrec
Endif
if getRawKeyPressed(39)>0
inc viewCurrent
gosub getrec
Endif
if viewCurrent<1 then viewCurrent = 1
if viewCurrent>10 then viewCurrent = 10
Print(Array1[viewCurrent,1] + " - " + Array1[viewCurrent,2])
Print(Array2[s,1] + " - " + Array2[s,2])
Print(str(s))
Sync()
loop
getrec:
For s = 1 to 10
If Array2[s,2] = Array1[viewCurrent,1]
Exit
Endif
Next
Return