IndexOf function
Prototype: |
function IndexOf(const Value :integer) :integer; |
|
Description: |
IndexOf function returns index position of first matching found value parameter. If the value does not exist in the IntegerList then returns -1. |
|
Syntax: |
variable:= StringList.IndexOf(Value); |
|
Part |
Description |
|
variable |
A variable declared as an integer |
|
IntegerList |
A reference to an instance of a TIntegerListWrapper |
|
Value |
An integer parameter to be found |
|
Return value: |
an index position of first matching found value parameter. Or returns -1 if the integer does not exist in the IntegerList |
|
Example:
var
intList : TIntegerListWrapper;
v, i : integer;
begin
intList := CreateIntegerList;
intList.Add(2);
intList.Add(4); // it will be found
intList.Add(8);
intList.Add(4);
v:= intList.IndexOf(4);
ShowMsg(IntToStr(v));
intList.Free;
end.
Output in Field-Map Data Collector:
![]()
See also:
Free; Add; Clear; Assign; Delete; Count; IndexOf; SortAscending; SortDescending; SortAscendingAndRemoveDuplicates; Value; Delimiter; DelimitedText; AsVarArray
© 2024 IFER-Monitoring and Mapping Solutions