Every
Description
The Every() method determines whether all entries in the array are the same as the SearchElement, returning True or False as appropriate.
Syntax
expression.Every(SearchElement, [FromIndex])
Parameters
- Name
- SearchElement
- Type
- Variant
- Necessity
- Required
- Description
- The value to search for.
- Name
- FromIndex
- Type
- Long
- Necessity
- Optional
- Description
- The position in this array at which to begin searching for SearchElement; the first character to be searched is found atFromIndexfor positive values ofFromIndex, or at the array’sLengthproperty +FromIndexfor negative values ofFromIndex(using the absolute value ofFromIndexas the number of characters from the end of the array at which to start the search). Defaults to the array’sLowerBoundproperty.
Returns
- Type
- Boolean
- Description
- Trueif the array includes- SearchElement,- Falseif not.
Example
Public Sub EveryExample()
    Dim MyArray As BetterArray
    Dim result As Boolean
    Set MyArray = New BetterArray
    MyArray.Push "Foo", "Foo", "Foo", "Foo"
    result = MyArray.Every("Foo")
    ' expected output:
    ' result is True
End Sub