Summary
Splits the calling vector to an array of TVec objects.
Class
TVec
Declaration
Procedure Split(const Dst: array of TVec; const DstSize: array of integer);
Description
Copy the contents of the calling TVec object to the TVec objects in Dst array. The Length of objects in Dst array is defined in the DstSize array. The
Length and
Complex properties of vectors in Dst array are set implicitly. An exception is raised if the sum of DstSize lengths exceeds the
Length of the calling vector.
Declaration
Procedure Split(Vec1: TVec; Offset: integer; Vec2: TVec);
Description
Copy the contents of the calling TVec object to Vec1 and Vec2 objects. The
Length and
Complex properties of are set implicitly. An exception is raised, if Offset parameter exceeds the length of the calling vector. The
Length property of Vec1 object is set to Offset and the Length of Vec2 is set to the rest.
Declaration
Function Split(const Dst: array of TVec): TVec;
Description
Copy the contents of the calling TVec object to the TVec objects in Dst array. The
Length and
Complex properties of vectors in Dst array must be set explicitly. An exception is raised, if
Complex properties of TVec objects do not match or the sum of TVec lengths exceeds the
Length of the calling vector.
Example 1
var a,b,c,d: TVec;
begin
CreateIt(a,b,c,d);
try
a.SetIt(False,[0,0,0,0,1,2,3,1,2,3]);
a.Split([b,c,d],[4,3,3]);
// b = [0,0,0,0], c = [1,2,3], d = [1,2,3]
finally
FreeIt(a,b,c,d);
end;
end;
| Copyright 2008 Dew Research |
http://www.dewresearch.com