Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {==============================================================================]
- Explanation: Merges T2DStrArray (ATSA) to TStrArray.
- [==============================================================================}
- function ATSAMerge(ATSA: T2DStrArray): TStrArray;
- var
- i, i2, h, h2, r: Integer;
- begin
- h := High(ATSA);
- if (h > -1) then
- begin
- for i := 0 to h do
- IncEx(r, (High(ATSA[i]) + 1));
- SetLength(Result, r);
- r := 0;
- for i := 0 to h do
- begin
- h2 := High(ATSA[i]);
- for i2 := 0 to h2 do
- begin
- Result[r] := string(ATSA[i][i2]);
- Inc(r);
- end;
- end;
- end else
- SetLength(Result, 0);
- end;
- var
- a, b, c, tmp: TStrArray;
- h, i: Integer;
- begin
- ClearDebug;
- a := ['a'];
- b := ['b'];
- c := ['c'];
- tmp := ATSAMerge([a, b, c]);
- h := High(tmp);
- for i := 0 to h do
- WriteLn(tmp[i]);
- end.
Advertisement
Add Comment
Please, Sign In to add comment