I am trying to remove an item from an array. The array is not dynamic!
I found many examples on how to do it for the dynamic variant but none for the static.
example from delphi:
var
A: array of integer;
begin
...
A:=[1,2,3,4];
Delete(A,1,2); //A will become [1,4]
...
end;
example from another site:
type
TIntArray = array of Integer;
procedure DeleteArrayElement(var AArray: TIntArray; const AIndex: Integer);
begin
Move(AArray[AIndex + 1], AArray[AIndex], SizeOf(AArray[0]) * (Length(AArray) - AIndex - 1));
SetLength(AArray, Length(AArray) - 1);
end;
...
//call via
DeleteArrayElement(IntArray, 3);
...
My array is defined as 0 .. 11 so this is not dynamic(i guess)?
When I try to use the SetLength function it says incompatible types.
Any idea how to solve this?