Difference between revisions of "TIAMaxEx"

From SCAR Divi Manual
Jump to: navigation, search
(Created page with "==Definition== <source lang="scar" lines="false"> function TIAMax(const TIA: TIntArray): Integer; </source> ==Availability== SCAR Divi 3.34 > Current ==Description== Returns th...")
 
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
==Definition==
 
==Definition==
 
<source lang="scar" lines="false">
 
<source lang="scar" lines="false">
function TIAMax(const TIA: TIntArray): Integer;
+
function TIAMaxEx(const TIA: TIntArray; out Index: Integer): Integer;
 
</source>
 
</source>
  
Line 27: Line 27:
 
*[[TIAMax]]
 
*[[TIAMax]]
 
*[[TIAMinEx]]
 
*[[TIAMinEx]]
 +
*[[TIARange]]
  
 
[[Category:Functions]]
 
[[Category:Functions]]
 
[[Category:TIA Functions]]
 
[[Category:TIA Functions]]
 
[[Category:Array Functions]]
 
[[Category:Array Functions]]
 +
[[Category:Math Functions]]

Latest revision as of 16:54, 12 December 2012

Definition

function TIAMaxEx(const TIA: TIntArray; out Index: Integer): Integer;

Availability

SCAR Divi 3.34 > Current

Description

Returns the largest number in a given TIA and the first index where it was found in Idx. The function throws an exception if the size of the given TIA is 0.

Example

var
  Idx: Integer;
begin
  WriteLn(TIAMaxEx([2, 4, 3, 6, 8, 5, 1, 2], Idx));
  WriteLn('Index: ' + IntToStr(Idx));
end.

Output:

8
Index: 4

See Also