on Apr 21st, 2015, 8:19pm, Kirkkaf13 wrote:Is it possible to resize an array and keep the index values previously initialized? |
|
There's a Wiki article on exactly that subject, I'm surprised you didn't find it yourself:
http://bb4w.wikispaces.com/Re-dimensioning+arrays
From your description what you probably need is the PROCredimpreserve1d() routine. There's an example of its use listed in the article:
Code: DIM array(100)
FOR I% = 0 TO 100
array(I%) = SQR(I%)
NEXT
PROCredimpreserve1d(array(), ^array(1)-^array(0), 200)
FOR I% = 101 TO 200
array(I%) = SQR(I%)
NEXT
FOR I% = 0 TO 200
IF array(I%) <> SQR(I%) STOP
NEXT
PRINT "Test completed successfully"
END
Richard.