The Size of an Array Must Be a Constant or a Number

From Xojo Documentation

Error message

When you declare and size an array using a Dim statement, the size of the array must be indicated by either a constant or a number.

Notes

If you need a variable length array, declare the array as having no bounds and then use the Append method to add elements, such as:

Dim myArray (-1) As Integer
myArray.Append(5)

Examples

Trying to size an array using a variable:

See Also

Dim statement.