Ralle1976

Dictionray

Nov 6th, 2019
571
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. #Region Dictionray Helpers
  2. ; Adds a key and item pair to a Dictionary object.
  3. Func _AddItem(ByRef $oDictionary, $v_key, $v_item)
  4. $oDictionary.ADD($v_key, $v_item) ;)
  5. EndFunc ;==>_AddItem
  6.  
  7. ; Returns true if a specified key exists in the Dictionary object, false if it does not.
  8. Func _ItemExists(ByRef $oDictionary, $v_key)
  9. Return $oDictionary.Exists($v_key)
  10. EndFunc ;==>_ItemExists
  11.  
  12. ; Returns an item for a specified key in a Dictionary object
  13. Func _Item(ByRef $oDictionary, $v_key)
  14. Return $oDictionary.Item($v_key)
  15. EndFunc ;==>_Item
  16.  
  17. ; Sets an item for a specified key in a Dictionary object
  18. Func _ChangeItem(ByRef $oDictionary, $v_key, $v_item)
  19. $oDictionary.Item($v_key) = $v_item
  20. EndFunc ;==>_ChangeItem
  21.  
  22. ; Sets a key in a Dictionary object.
  23. Func _ChangeKey(ByRef $oDictionary, $v_key, $v_newKey)
  24. $oDictionary.Key($v_key) = $v_newKey
  25. EndFunc ;==>_ChangeKey
  26.  
  27. ; Removes a key, item pair from a Dictionary object.
  28. Func _ItemRemove(ByRef $oDictionary, $v_key)
  29. $oDictionary.Remove($v_key)
  30. EndFunc ;==>_ItemRemove
  31.  
  32. ; Returns the number of items in a collection or Dictionary object.
  33. Func _ItemCount(Const ByRef $oDictionary)
  34. Return $oDictionary.Count
  35. EndFunc ;==>_ItemCount
  36.  
  37. ; Returns an array containing all the items in a Dictionary object
  38. Func _GetItems(Const ByRef $oDictionary)
  39. Return $oDictionary.Items
  40. EndFunc ;==>_GetItems
  41. #EndRegion Dictionray Helpers
Advertisement
Add Comment
Please, Sign In to add comment