' 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
QuoteI recently retired and as part of this new life transition, I will be closing the SQLitening forums and pulling back from programming in general after a brief transitional period as outlined below:
April 14 to April 30, 2024: No changes.
May 1, 2024: The forum will become read only disallowing new posts and no new member registrations.
May 31, 2024: The forum will be removed.
Additionally, I will not be answering programming questions via email.
If there is anything on this forum that you would like to archive for your own purposes then it is imperative that you do so before May 31, 2024.
Thanks,
Paul Squires
Page created in 0.117 seconds with 18 queries.