[pb450 b3 x86] DIM and Swap in combiantion = IMA
Posted: Mon May 03, 2010 4:03 pm
see http://www.purebasic.fr/english/viewtop ... 04&start=0 for details
this code causes an IMA because after the second Swap (and DIM) array_1 dimensions are set to -1,-1
this code causes an IMA because after the second Swap (and DIM) array_1 dimensions are set to -1,-1
Code: Select all
Dim array_1.s(1, 10)
Dim array_2.s(0, 0)
;create some content
For x = 1 To 10
array_1(1, x) = Chr(60 + x)
Next
rows = 1
cols = 10
For m = 1 To 2
nrows = rows
ncols = cols
Dim array_2.s(0, 0); set content to nothing
Dim array_2.s(nrows, ncols)
Swap array_1(), array_2()
Debug array_2(1, m)
Dim array_1.s(0, 0)
Dim array_1.s(nrows, ncols)
Swap array_2(), array_1(); now array_1 should contain the original content .. but is set to -1,-1 ....
rows = nrows
cols = ncols
Next