The function doesn't do what you think it does.
Behind the scenes, DBPro maintains a 'current pointer' so that when you access an array item without specifying the index, it uses this pointer instead - 'x = MyArray()' will fetch the value from MyArray using the current pointer and put the value into x.
The ARRAY INDEX VALID simply tells you whether that pointer points to a valid item within the array.
dim MyArray(0) as integer
print array index valid( MyArray() ) ` prints 1 as the pointer points to item 0
previous array index MyArray()
pritn array index valid( MyArray() ) ` prints 0 as the pointer points to -1, which is not valid
You probably want to check your index against 0 and ARRAY COUNT():
if index >= 0 and index <= ARRAY COUNT( MyArray() )
` index is valid
endif