Difference between revisions of "TIADelete"

From SCAR Divi Manual
Jump to: navigation, search
(Created page with "==Definition== <source lang="scar" lines="false"> procedure TIADelete(var TIA: TIntArray; const Index: Integer); </source> ==Availability== SCAR Divi 3.28 > Current ==Descripti...")
 
 
(3 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 TIADelete(var TIA: TIntArray; const Index: Integer);
+
function TIADelete(var TIA: TIntArray; const Index: Integer): Integer;
 
</source>
 
</source>
  
 
==Availability==
 
==Availability==
 
SCAR Divi 3.28 > Current
 
SCAR Divi 3.28 > Current
 +
 +
*Before 3.32.01 the function didn't do anything when the index was out of bounds.
  
 
==Description==
 
==Description==
Deletes the [[Integer|integer]] at a given position '''Index''' in a given [[TIntArray]] '''TIA'''. If the index is outside of the array bounds, nothing happens.
+
Deletes the [[Integer|integer]] at a given position '''Index''' in a given [[TIntArray]] '''TIA'''. The function returns the value it deleted from the array. If the index is outside of the array bounds, the function throws an exception.
  
 
==Example==
 
==Example==
Line 30: Line 32:
 
*[[TIAUnique]]
 
*[[TIAUnique]]
 
*[[TIAAppend]]
 
*[[TIAAppend]]
 +
*[[TIAInsert]]
  
 
[[Category:Functions]]
 
[[Category:Functions]]
 
[[Category:TIA Functions]]
 
[[Category:TIA Functions]]
 
[[Category:Array Functions]]
 
[[Category:Array Functions]]

Latest revision as of 15:42, 22 May 2012

Definition

function TIADelete(var TIA: TIntArray; const Index: Integer): Integer;

Availability

SCAR Divi 3.28 > Current

  • Before 3.32.01 the function didn't do anything when the index was out of bounds.

Description

Deletes the integer at a given position Index in a given TIntArray TIA. The function returns the value it deleted from the array. If the index is outside of the array bounds, the function throws an exception.

Example

var
  TIA: TIntArray;

begin
  TIA := [1, 2, 3];
  TIADelete(TIA, 1);
  WriteLn(TIAToStr(TIA));
end.

Output:

1,3

See Also