Janilabo Posted May 22, 2012 Share Posted May 22, 2012 ATSA to TSA. Example included. ATSAMerge [scar]function ATSAMerge(ATSA: T2DStringArray): TStringArray; var i, i2, h, h2, r: Integer; begin h := High(ATSA); for i := 0 to h do IncEx(r, (High(ATSA) + 1)); SetLength(Result, r); r := 0; for i := 0 to h do begin h2 := High(ATSA); for i2 := 0 to h2 do begin Result[r] := ATSA[i2]; Inc®; end; end; end; var ATSA: T2DStringArray; TSA: TStringArray; h, i: Integer; begin ClearDebug; SetLength(ATSA, 4); ATSA[0] := ['Test0']; ATSA[1] := ['Test1', 'Test2']; ATSA[2] := ['Test3', 'Test4', 'Test5']; ATSA[3] := ['Test6', 'Test7', 'Test8', 'Test9']; TSA := ATSAMerge(ATSA); SetLength(ATSA, 0); h := High(TSA); for i := 0 to h do WriteLn('TSA[' + IntToStr(i) + ']: ' + TSA); SetLength(TSA, 0); end.[/scar] Quote Link to comment Share on other sites More sharing options...