Skip to content

Commit

Permalink
Enhance MergeDictionary function
Browse files Browse the repository at this point in the history
The dictionaries are now effectively merged, including shared keys. (Incoming values replace existing values where the keys match.) This is used for overlaying .env options on top of a defined schema entry. (For example, to disable sync on a particular computer.) #415
  • Loading branch information
joyfullservice committed Aug 1, 2023
1 parent 93956ee commit f710ce5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Version Control.accda.src/modules/modFunctions.bas
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ End Sub
'---------------------------------------------------------------------------------------
' Procedure : MergeDictionary
' Author : Adam Waller
' Date : 5/27/2021
' Purpose : Merge a dictionary into another dictionary. (Does not check for duplicate
' : key values, which will throw an error.)
' Date : 7/31/2023
' Purpose : Merge a dictionary into another dictionary. Existing values are replaced
' : from the incoming dictionary.
'---------------------------------------------------------------------------------------
'
Public Sub MergeDictionary(ByRef dOriginal As Dictionary, ByVal dToAdd As Dictionary)
Dim varKey As Variant
For Each varKey In dToAdd.Keys
dOriginal.Add varKey, dToAdd(varKey)
dOriginal(varKey) = dToAdd(varKey)
Next varKey
End Sub

Expand Down

0 comments on commit f710ce5

Please sign in to comment.