Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {==============================================================================]
- Explanation: Returns TSA with x items, count being the size of the result.
- [==============================================================================}
- function TSAOfStringEx(x: TStrArray; count: Integer): TStrArray;
- var
- i, l: Integer;
- begin
- l := Length(x);
- if ((count > 0) and (l > 0)) then
- begin
- SetLength(Result, count);
- for i := 0 to (count - 1) do
- Result[i] := string(x[i mod l]);
- end else
- SetLength(Result, 0);
- end;
- var
- tmp: TStrArray;
- h, i: Integer;
- begin
- ClearDebug;
- tmp := TSAOfStringEx(['a', 'b', 'c'], 8);
- h := High(tmp);
- for i := 0 to h do
- WriteLn(tmp[i]);
- end.
Advertisement
Add Comment
Please, Sign In to add comment