auch will ... auch will ... *hibblig rumhüpf*
Delphi-Quellcode:
SetLength(array3, Length(array1) + Length(array2));
z := Min(Length(array1), Length(array2));
x := 0;
For i := 0 to z - 1 do Begin
array3[x] := array1[i];
Inc(x);
array3[x] := array2[i];
Inc(x);
End;
For i := z to High(array1) do Begin
array3[x] := array1[i];
Inc(x);
End;
For i := z to High(array2) do Begin
array3[x] := array2[i];
Inc(x);
End;
und in Kurz:
Delphi-Quellcode:
SetLength(array3, Length(array1) + Length(array2));
z := Min(Length(array1), Length(array2));
For i := 0 to z - 1 do Begin
array3[i * 2] := array1[i];
array3[i * 2 + 1] := array2[i];
End;
For i := z to High(array1) do array3[z + i] := array1[i];
For i := z to High(array2) do array3[z + i] := array2[i];