SHARE
TWEET

Untitled

a guest Jul 12th, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Option Explicit
  2.  
  3. Public myDict As Dictionary
  4.  
  5. Sub InitializeDict()
  6.     Set myDict = New Dictionary
  7.  
  8.     With myDict
  9.         .Add "legal", 0
  10.         .Add "orphans", 0
  11.         .Add "transfer_share", 0
  12.         .Add "internet", 0
  13.         .Add "xborder", 0
  14.     End With
  15.  
  16. End Sub
  17.  
  18. Sub incrementVariable(myFunction As String)
  19.     If myDict.Exists(myFunction) Then
  20.         myDict(myFunction) = myDict(myFunction) + 2
  21.     End If
  22. End Sub
  23.  
  24. Sub test()
  25.     InitializeDict
  26.     Debug.Print myDict("internet")
  27.     incrementVariable ("internet")
  28.     Debug.Print myDict("internet")
  29. End Sub
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top