Static arrays allow to define their low and high bounds:
StaticArray : array[5..7] of Integer;
I don't know how to do the same thing with dynamic arrays at runtime.
For example, if I need to copy the elements from a static array, keeping the same indexes, I don't know how to set its low bound to Low(StaticArray) and high bound to High(StaticArray):
var
StaticArray : array[5..7] of Integer;
DynamicArray : array of Integer;
i : integer;
begin
//initializing static array
StaticArray[5] := 1;
StaticArray[6] := 2;
StaticArray[7] := 3;
//setting the same length and bounds to the dynamic array
//?
//copying elements
i := 0;
for i := Low(StaticArray) to High(StaticArray) do
DynamicArray[i] := StaticArray[i];
end;
Is there any way for setting the low/high bounds of a dynamic array, or do they always have 0 as low bound and Length(Array) - 1 as high bound?
1.. 6instead of0.. 5), but that would be as trivially pointless as distinguishing between fixed point decimals and plain integers.