Janilabo

Janilabo | TSACopy() [SCAR Divi]

Apr 27th, 2013
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.64 KB | None | 0 0
  1. {==============================================================================]  
  2.   Explanation: Returns copy of TSA.                  
  3. [==============================================================================}
  4. function TSACopy(TSA: TStrArray): TStrArray;
  5. var
  6.   h, i: Integer;
  7. begin
  8.   h := High(TSA);
  9.   SetLength(Result, (h + 1));
  10.   for i := 0 to h do
  11.     Result[i] := string(TSA[i]);
  12. end;
  13.  
  14. var
  15.   h, i: Integer;
  16.   a, b: TStrArray;
  17.  
  18. begin
  19.   ClearDebug;
  20.   a := ['Test1', 'Test2', 'Test3', 'Test4'];
  21.   b := TSACopy(a);
  22.   SetLength(a, 0);
  23.   h := High(b);
  24.   for i := 0 to h do
  25.     WriteLn(b[i]);
  26.   SetLength(b, 0);
  27. end.
Advertisement
Add Comment
Please, Sign In to add comment