Array with 1 row not working with for loop

I am a little confused because I have a for loop as following:

LastRowInArray = myAry.ubound for lp as integer = 0 to LastRowInArray next

This works fine except when my array only has one row so the ubound returns a 0 into LastRowInArray and it would appear that Xojo doesnt process the loop if the start and end are the same. Is this correct, how do people code around this?

That is not correct. There must be something else going on.

Not correct. This code works (do it all the time).

I suggest you look around for what else is affecting the array.

Remember Arrays as 0-Based… so the first entry is index 0, the second is index 1 etc…
If an array is “empty” UBOUND=(-1)

Thanks everyone, I had used the ".count - 1"in one method to get the last row and had then changed it to use “.ubound” but forgot to remove the “-1”. I really do love using dictionary and classes but the code is a lot more spread around which is taking a little longer to get used to.