Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function CopyTSAEx(TSA: array of string; startIndex, count: Integer): array of string;
- var
- i, l, t: Integer;
- begin
- l := Length(TSA);
- if (startIndex < 0) then
- startIndex := 0;
- if ((l >= startIndex) and (count > 0)) then
- begin
- t := (l - startIndex);
- if (count > t) then
- count := t;
- SetLength(Result, count);
- for i := startIndex to ((startIndex + count) - 1) do
- Result[(i - startIndex)] := TSA[i];
- end;
- end;
- var
- TSA: array of string;
- i: Integer;
- begin
- ClearDebug;
- TSA := CopyTSAEx(['TEST1', 'TEST2', 'TEST3', 'TEST4', 'TEST5', 'TEST6', 'TEST7'], 2, 3);
- for i := 0 to High(TSA) do
- WriteLn(TSA[i]);
- SetLength(TSA, 0);
- end.
Advertisement
Add Comment
Please, Sign In to add comment