Function List Class

Update

Change one of the Values in the List . Change one or all of the copies of a specific Value to some other Value . Function returns True if the Value was found and successfully changed. Function returns False otherwise.

Signature (Visual Basic / VBA)

Public Function Update( _
      ByVal vFromValue As Variant _
    , ByVal vToValue As Variant _
    , Optional ByVal vCompare As Variant _
    , Optional ByVal vUpdateAll As Variant _
    ) As Boolean

Code Example

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

Parameters

Parameter Description
vFromValue The Value that will be changed if it exists within the List . vValue can be any type of Variant value on which comparisons can be made using the EqualLikeDataTypeFast function (vbString, numeric, vbDate, etc.).
vToValue The new Value that will replace vFromValue.
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.
vUpdateAll True if all instances of Value vFromValue should be changed to vToValue within the List . False if at most one instance of Value vFromValue should be changed to vToValue. vUpdateAll defaunts to False (at most one instance/copy of vFromValue will be changed) if it is missing.

Return Value

Function returns True if vFromValue was found in List .

Notes & Version History

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.
v2.0 Change Changed the vUpdateAll argument so that it can no longer be Null or non-numeric. It is still Optional though, so it can be missing.
v1.3 BugFix This Function has been fixed to support the storage of Object and DataObject type Values.