01-05-2023, 09:07 PM
one tip:
_PRESERVE works only with monodimensional array...
moreover it is the exact duplicate of _PRESERVE of QB7.1 / QB PDS
run this code to catch the issue
This lets suppose that array is a stack and not a set of cell of memory ordered by pointers.
_PRESERVE works only with monodimensional array...
moreover it is the exact duplicate of _PRESERVE of QB7.1 / QB PDS
run this code to catch the issue
Code: (Select All)
'$dynamic
ReDim threeDim(1 To 10, 1 To 5, 1 To 3)
Screen _NewImage(100, 30, 0)
For a = 1 To 10
For b = 1 To 5
For c = 1 To 3
threeDim(a, b, c) = a + (b * 10) + (c * 100)
First$ = First$ + Str$(threeDim(a, b, c)) + "/"
Next c, b
First$ = First$ + "|"
Next a
Print First$
Print "<------------------------------------------------->"
ReDim _Preserve threeDim(1 To 12, 1 To 5, 1 To 5)
For a = 1 To 12
For b = 1 To 5
For c = 1 To 5
Second$ = Second$ + Str$(threeDim(a, b, c)) + "/"
Next c, b
Second$ = Second$ + "|"
Next a
Print Second$
This lets suppose that array is a stack and not a set of cell of memory ordered by pointers.