Difference between revisions of "TPADelete"

From SCAR Divi Manual
Jump to: navigation, search
(Description)
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
==Definition==
 
==Definition==
 
<source lang="scar" lines="false">
 
<source lang="scar" lines="false">
procedure TPARemove(var TPA: TPointArray; const Index: Integer);
+
function TPADelete(var TPA: TPointArray; const Index: Integer): TPoint;
 
</source>
 
</source>
  
 
==Availability==
 
==Availability==
SCAR Divi 3.26 > Current
+
SCAR Divi 3.28 > Current
 +
 
 +
===Aliases===
 +
*TPARemove (SCAR Divi 3.26 > SCAR Divi 3.27)
  
 
==Description==
 
==Description==
Removes the coordinate at a given position '''Index''' in a given [[TPointArray]] '''TPA'''. If the index is outside of the array bounds, nothing happens.
+
Deletes the [[TPoint]] at a given position '''Index''' in a given [[TPointArray]] '''TPA''' and returns the deleted value. If the index is outside of the array bounds, nothing happens.
  
 
==Example==
 
==Example==
Line 14: Line 17:
 
var
 
var
 
   TPA: TPointArray;
 
   TPA: TPointArray;
 +
  p: TPoint;
  
 
begin
 
begin
 
   TPA := [Point(0, 0), Point(2, 2), Point(5, 10)];
 
   TPA := [Point(0, 0), Point(2, 2), Point(5, 10)];
   TPARemove(TPA, 1);
+
   p := TPADelete(TPA, 1);
   WriteLn('TPointArray: ' + TPAToStr(TPA));
+
   WriteLn(TPAToStr(TPA));
 +
  WriteLn(IntToStr(p.X) + ',' + IntToStr(p.y));
 
end.
 
end.
 
</source>
 
</source>
  
 
Output:
 
Output:
  TPointArray: (0,0);(5,10)
+
  (0,0);(5,10)
 +
2,2
  
 
==See Also==
 
==See Also==
*[[TPARemovePoint]]
+
*[[TPARemove]]
*[[TPARemovePointEx]]
+
*[[TPARemoveEx]]
*[[TPARemoveDupl]]
+
*[[TPAUnique]]
 +
*[[TPAAppend]]
 +
*[[TPAInsert]]
  
 
[[Category:Functions]]
 
[[Category:Functions]]
 
[[Category:TPA Functions]]
 
[[Category:TPA Functions]]
 
[[Category:Array Functions]]
 
[[Category:Array Functions]]

Latest revision as of 16:49, 23 April 2012

Definition

function TPADelete(var TPA: TPointArray; const Index: Integer): TPoint;

Availability

SCAR Divi 3.28 > Current

Aliases

  • TPARemove (SCAR Divi 3.26 > SCAR Divi 3.27)

Description

Deletes the TPoint at a given position Index in a given TPointArray TPA and returns the deleted value. If the index is outside of the array bounds, nothing happens.

Example

var
  TPA: TPointArray;
  p: TPoint;

begin
  TPA := [Point(0, 0), Point(2, 2), Point(5, 10)];
  p := TPADelete(TPA, 1);
  WriteLn(TPAToStr(TPA));
  WriteLn(IntToStr(p.X) + ',' + IntToStr(p.y));
end.

Output:

(0,0);(5,10)
2,2

See Also