Quote Originally Posted by marmin
Quote Originally Posted by cronodragon
You can always use out of range tricks:

type
parr = ^tarr;
tarr = array[1..1] of Byte;

var
src: array of Byte;
mask: parr;

...

SetLength(src, 100);
mask := @src[0]; // does it work with "mask := src;" ? maybe...

for i := 1 to Length(src) do
mask[i] := x;

...
But I think that will overwrite memory space tthat's used?
That's why it is an out of range trick. Just be careful to set the limits 1 to Length(array). And anyways, with dynamic array you have to take the same care, because the compiler is not going to tell you if there is an out of range error if you use a variable for indexing, instead of a constant.