Try this:
Code:
$objDictionary = CreateObject("Scripting.Dictionary")
DictionarySetValue($objDictionary, "atl-dc-01", "No status")
DictionarySetValue($objDictionary, "atl-dc-02", "No status")
DictionarySetValue($objDictionary, "atl-dc-03", "No status")
$colKeys = $objDictionary.Keys
For Each $strKey in $colKeys
? $strKey + " = " + $objDictionary.Item($strKey)
Next
? "==================="
DictionarySetValue($objDictionary, "atl-dc-01", "Available")
DictionarySetValue($objDictionary, "atl-dc-02", "Available")
DictionarySetValue($objDictionary, "atl-dc-03", "Unavailable")
DictionarySetValue($objDictionary, "atl-dc-04", "No status")
$colKeys = $objDictionary.Keys
For Each $strKey in $colKeys
? $strKey + " " + $objDictionary.Item($strKey)
Next
??
function DictionarySetValue($DictionaryObject, $key, $value)
if vartypename($DictionaryObject) <> "Object"
exit 13
endif
if vartypename($key) = "Empty"
exit 13
endif
if $DictionaryObject.Exists($key)
$DictionaryObject.Remove($key)
endif
$DictionaryObject.Add($key, $value)
exit @error
endfunction