Array Sizes

Are there any limits on array sizes? I have a string array dimensioned to 302 elements, but when I get to 298 I get an out of bounds error.

Following code compiles and executes without any errors on Windows 7, Xojo v2014r2.1 and a breakpoint at last line shows a value of “301” in strArray(301).

Dim strArray(302) As String For intLoop As Integer = 0 To 301 strArray(intLoop) = Trim(Str(intLoop)) Next strArray(301) = strArray(301)

Thanks for that. I will check further to see if there is something else causing my issue.

No inherent limit beyond the amount of RAM and the size of a uint32 for the indexes
300 is tiny
We were just doing some timing on arrays with millions of elements

May I also suggest the following edit:

For intLoop As Integer = 0 To strArray.Ubound

This allows you to change the ‘302’ array size without having to remember to change the ‘301’.