Android Question docs for list.insertAt are confusing/incorrect?

Dave O

Well-Known Member
Licensed User
Longtime User
Hi there,

Just discovered an error (or possibly just a confusion) in the docs for the List object's InsertAt method.

It's documented as:

InsertAt (Index As Int, Item As Object)
Inserts the specified element in the specified index.
As a result all items with index larger then the specified index are shifted.

As I understand this, if I have 4 items in a list, with indexes:
0, 1, 2, 3​

...and I do an InsertAt(2, foobar), I should get this (where foobar is now index 3):

0, 1, 2, 3, 4​

In other words, if I'm reading the docs correctly, it's an InsertAfter. However, in practice, it appears to be an InsertBefore. My new page above ends up at index 2.

Suggest revising the docs to say something like:

InsertAt (Index As Int, Item As Object)
Inserts the specified element in the specified index, before the current item at that index.
As a result all items with index equal to or larger then the specified index are shifted.

Hope this helps!
 
Top