redim
Posted: Sun Sep 28, 2025 2:47 am
Does redim clear the array?
I ran the following code:
It did not clear the array. But an online search result claimed that it does and that you need to use the "Preserve" keyword to keep the data. Yet the purebasic help makes no mention of this.
It may be that the problem is that I'm using an old version (6.00) but I'm not sure how to upgrade. I seem to remember that there was a separate link for licensed versions but that was years ago and I cannot find it.
I ran the following code:
Code: Select all
Dim parr(10)
OpenConsole()
For i=0 To 10
parr(i)=i
Next
For i=0 To 10
PrintN(Str(parr(i)))
Next
PrintN("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
ReDim parr(10)
For i=0 To 10
PrintN(Str(parr(i)))
Next
Input()
CloseConsole()
It may be that the problem is that I'm using an old version (6.00) but I'm not sure how to upgrade. I seem to remember that there was a separate link for licensed versions but that was years ago and I cannot find it.