When passing an array to by index to a function it is always referenced by index 0. Here is an example:
Sub test(byref a)
print a
End Sub
Dim a[5]
a[0] = 20
a[3]=5
test(a[3])
The above example should print 5 but in this case it will print 20. However you can still get the value in any index in the variable a like so:
Sub test(ByRef a)
print a[3]
End Sub
The above example will print the 3rd index in a. The main issue is just being able to pass an index of an array to a byref argument and having it behave like if it were a normal variable.