Contains(Value: Variant): Boolean;
Value. Value of the element, which presence should be checked.
The Contains method checks if the element with the Value value exists.
The method returns True if the value is in the collection, and False if the value is missing.
Sub UserProc;
Var
ArrayL: IArrayList;
i: Integer;
Begin
ArrayL := New ArrayList.Create;
For i := 0 To Math.RandBetweenI(0, 100) Do
ArrayL.Add(Math.RandBetweenI(0, 100));
End For;
If ArrayL.Contains(50) Then
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: