Difference between revisions of "CopyTIA"
From SCAR Divi Manual
(Created page with "==Definition== <source lang="scar" lines="false"> function CopyTIA(const TIA: TIntArray): TIntArray; </source> ==Availability== SCAR Divi 3.38 > Current ==Description== Crea...") |
(No difference)
|
Latest revision as of 16:53, 12 December 2012
Definition
function CopyTIA(const TIA: TIntArray): TIntArray;
Availability
SCAR Divi 3.38 > Current
Description
Creates a new TIntArray with a copy of every element in the given array TIA. An extended function with additional functionality is available as CopyTIAEx.
Example
var TIA, TIA2: TIntArray; begin TIA := [7, 6, 2, 0, 1]; TIA2 := TIA; SortTIA(TIA2); WriteLn('TIA passed by reference to TIA2:'); WriteLn('TIA: ' + TIAToStr(TIA)); WriteLn('TIA2: ' + TIAToStr(TIA2)); TIA := [7, 6, 2, 0, 1]; TIA2 := CopyTIA(TIA); SortTIA(TIA2); WriteLn('TIA passed by value to TIA2:'); WriteLn('TIA: ' + TIAToStr(TIA)); WriteLn('TIA2: ' + TIAToStr(TIA2)); end.
Output:
TIA passed by reference to TIA2: TIA: 0,1,2,6,7 TIA2: 0,1,2,6,7 TIA passed by value to TIA2: TIA: 7,6,2,0,1 TIA2: 0,1,2,6,7