QuoteHow do yo ufind out if the Array is 0-based or 1-based and how large it is?
' array index redim example, by frank bruebach
' oxygen basic
'
indexbase 1
DIM MyArray(10) AS INTEGER '1 TO 10
DIM i AS INTEGER
' Fill the array with some values
FOR i = LBOUND(MyArray) TO UBOUND(MyArray)
MyArray(i) = i * 10
NEXT i
' Display the values in the array
FOR i = LBOUND(MyArray) TO UBOUND(MyArray)
print "MyArray(" + STR(i) + ") = " + STR(MyArray(i))
NEXT i
' Re-dimension the array to have 15 elements
REDIM integer MyArray(15) '1 to 15
' Fill the new array elements with some values
FOR i = UBOUND(MyArray) - 4 TO UBOUND(MyArray)
MyArray(i) = i * 5
NEXT i
' Display the values in the re-dimensioned array
FOR i = LBOUND(MyArray) TO UBOUND(MyArray)
print "MyArray(" + STR(i) + ") = " + STR(MyArray(i))
NEXT i
Page created in 0.135 seconds with 15 queries.