Function List Class

Remove

Remove a Value from the List given the Value . Function returns True if the Value was found and removed. Function returns False otherwise.

Signature (Visual Basic / VBA)

Public Function Remove( _
      ByVal vValue As Variant _
    , Optional ByVal vCompare As Variant _
    ) As Boolean

Code Example

    Assuming
       Dim lstTemp As New List
       lstTemp.Add "FunctionName"
       lstTemp.Add "PropertyName"
    for example
       lstTemp.Remove("FunctionName") = True
       lstTemp.Remove("SubName") = False

Parameters

Parameter Description
vValue The Value that will be removed from the List . vValue can be any type of Variant value on which comparisons can be made using the EqualLikeDataTypeFast function (vbString, numeric, vbDate, etc.).
vCompare Specifies the type of string comparison used to determine if Names match. vCompare defaults to the value of the Compare Property if it is missing.

Notes & Version History

Note If there are multiple List entries with the same Value , this function will remove one of them.
v2.0 Change Changed the vCompare argument so that it can no longer be Null or non-numeric. It is still Optional though, so it can be missing.
v1.1 BugFix Fixed a bug in this function that caused it to not work in all cases.