Revision history for KeyPgPreserve


Revision [21812]

Last edited on 2017-08-12 09:48:36 by fxm [Updated "NOTE" (to match "Redim Preserve")]
Additions:
##[[KeyPgPreserve|Preserve]]##'s current behavior is to keep the original data contiguous in memory, and only expand or truncate the size of the memory (if resizing is not possible, the whole original data block is first shifted to another memory location).
Its behavior (with a single dimension) is well-defined only when the upper bound is changed. If the lower bound is changed, the current result is that the data is in effect shifted to start at the new lower bound.
If there are multiple dimensions, only the upper bound of only the first dimension may be changed safely. If the first dimension is reduced, the existing mappable data may be lost. If lower-order dimensions are resized at all, the effects can be hard to predict (because multidimensional arrays are stored in row-major order : values differing only in the last index are contiguous).
Deletions:
##[[KeyPgPreserve|Preserve]]##'s current behavior is to keep the original data contiguous in memory, and only expand or truncate the size of the memory.
Its behavior is only well-defined when the upper bound is changed. If the lower bound is changed, the current result is that the data is in effect shifted to start at the new lower bound.
If there are multiple dimensions, only the upper bound of the first dimension may be changed safely. If lower-order dimensions are resized at all, the effects can be hard to predict.


Revision [21738]

Edited on 2017-01-21 15:04:37 by fxm [Added a precision on the non preservation of absolute addresses in memory]
Additions:
Used with ##[[KeyPgRedim|Redim]]## so that when an array is resized, data is not reset but is preserved. This means when the array is enlarged that only new data is reset, while the old data remains the same (but not necessarily at the same absolute addresses in memory).
Deletions:
Used with ##[[KeyPgRedim|Redim]]## so that when an array is resized, data is not reset but is preserved. This means when the array is enlarged that only new data is reset, while the old data remains the same.


Revision [21090]

Edited on 2016-03-13 09:22:02 by fxm [Formatting]
Additions:


Revision [20463]

Edited on 2016-02-10 16:07:04 by DkLwikki [Update link format]
Additions:
Used with ##[[KeyPgRedim|Redim]]## to preserve contents will resizing an array
[[KeyPgRedim|redim]] **Preserve** //array//(...) [[[KeyPgAs|as]] [[DataType|datatype]]]
Used with ##[[KeyPgRedim|Redim]]## so that when an array is resized, data is not reset but is preserved. This means when the array is enlarged that only new data is reset, while the old data remains the same.
**NOTE**: ##**Redim** [[KeyPgPreserve|Preserve]]## may not work as expected in all cases:
##[[KeyPgPreserve|Preserve]]##'s current behavior is to keep the original data contiguous in memory, and only expand or truncate the size of the memory.
- ##[[KeyPgDim|Dim]]##
- ##[[KeyPgLbound|Lbound]]##
- ##[[KeyPgRedim|Redim]]##
- ##[[KeyPgUbound|Ubound]]##
Deletions:
Used with ##[[KeyPgRedim Redim]]## to preserve contents will resizing an array
[[KeyPgRedim redim]] **Preserve** //array//(...) [[[KeyPgAs as]] [[DataType datatype]]]
Used with ##[[KeyPgRedim Redim]]## so that when an array is resized, data is not reset but is preserved. This means when the array is enlarged that only new data is reset, while the old data remains the same.
**NOTE**: ##**Redim** [[KeyPgPreserve Preserve]]## may not work as expected in all cases:
##[[KeyPgPreserve Preserve]]##'s current behavior is to keep the original data contiguous in memory, and only expand or truncate the size of the memory.
- ##[[KeyPgDim Dim]]##
- ##[[KeyPgLbound Lbound]]##
- ##[[KeyPgRedim Redim]]##
- ##[[KeyPgUbound Ubound]]##


Revision [16916]

Edited on 2013-08-17 09:25:06 by CountingPine ['As DataType' is optional - indeed, redundant - on Redim Preserve]
Additions:
[[KeyPgRedim redim]] **Preserve** //array//(...) [[[KeyPgAs as]] [[DataType datatype]]]
Deletions:
[[KeyPgRedim redim]] **Preserve** //array//(...) [[KeyPgAs as]] [[DataType datatype]]


Revision [13722]

Edited on 2008-09-11 13:09:27 by CountingPine [Notes on where it can be used properly]
Additions:
**NOTE**: ##**Redim** [[KeyPgPreserve Preserve]]## may not work as expected in all cases:
##[[KeyPgPreserve Preserve]]##'s current behavior is to keep the original data contiguous in memory, and only expand or truncate the size of the memory.
Its behavior is only well-defined when the upper bound is changed. If the lower bound is changed, the current result is that the data is in effect shifted to start at the new lower bound.
If there are multiple dimensions, only the upper bound of the first dimension may be changed safely. If lower-order dimensions are resized at all, the effects can be hard to predict.
dim i as integer
redim preserve array(1 to 10)
for i = 1 to 10
- ##**Preserve**## wasn't supported until PDS 7.1
Deletions:
In arrays with more than one dimension the data is preserved if only the first index is redimensioned (arrays are stored in row-major order, so it's the first, not the last subscription). If indexes other than the first one are redimensioned, the data will not be preserved.
Dim i as integer
redim preserve array(2 to 10)
for i = 2 to 10
- PRESERVE wasn't supported until PDS 7.1


Revision [13612]

Edited on 2008-07-22 00:34:55 by AntoniGual [Notes on where it can be used properly]
Additions:
In arrays with more than one dimension the data is preserved if only the first index is redimensioned (arrays are stored in row-major order, so it's the first, not the last subscription). If indexes other than the first one are redimensioned, the data will not be preserved.
Deletions:
In arrays with more than one dimension, only the first subscription can be redimensioned (arrays are stored in row-major order, so it's the first, not the last subscription).


Revision [9900]

The oldest known version of this page was created on 2007-07-22 20:49:29 by JeffMarshall [Notes on where it can be used properly]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki



sf.net phatcode