Janilabo Posted July 14, 2012 Share Posted July 14, 2012 [scar]function CopyTSAEx(TSA: TStrArray; startIndex, count: Integer): TStrArray; 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; end; end; var TSA: TStrArray; h, i: Integer; begin TSA := CopyTSAEx(['TEST1', 'TEST2', 'TEST3', 'TEST4', 'TEST5', 'TEST6', 'TEST7'], 1, 5); h := High(TSA); for i := 0 to h do WriteLn(TSA); SetLength(TSA, 0); end.[/scar] Quote Link to comment Share on other sites More sharing options...