IList.Contains

Syntax

Contains(Value: Variant): Boolean;

Parameters

Value. Value of the element, which presence should be checked.

Description

The Contains method checks if the element with the Value value exists.

Comments

The method returns True if the value is in the collection, and False if the value is missing.

Example

Sub UserProc;
Var
    ArrayL: IArrayList;
    i: Integer;
Begin
    ArrayL := 
New ArrayList.Create;
    
For i := 0 To Math.RandBetweenI(0100Do
        ArrayL.Add(Math.RandBetweenI(
0100));
    
End For;
    
If ArrayL.Contains(50Then
        Debug.WriteLine(
"The array contains the value 50");
    
Else
        Debug.WriteLine(
"the array does not contain the value 50");
    
End If;
End Sub UserProc;

After executing the example a dynamic array with random values is created. The development environment console displays information about presence of the 50 value in the array.

See also:

IList