<-- Previous || Up || Next -->

Update Function
List Class

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

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.

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
See also:
    AddOrUpdate Subroutine
    Add Subroutine
    Lookup Function
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.

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.
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.
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.

Return value: Function returns True if vFromValue was found in List.
v1.3 BugFix: This Function has been fixed to support the storage of Object and DataObject type Values.

Copyright 1996-1999 Entisoft
Entisoft Tools is a trademark of Entisoft.