Another flash from the past

Started by spl, April 13, 2024, 08:27:01 AM

Previous topic - Next topic

spl

Before Wil Maps were introduced there was this [circa 2012-13]
Gosub udfs
d = CreateObject("Scripting.Dictionary")
d.Add("[Key]","[Item]")
d.Add("Country","Capital")
d.Add("Greece", "Athens")     
d.Add("Yugoslavia", "Belgrade")
d.Add("Germany", "Berlin")
d.Add("France", "Paris")
d.Add("Italy","Naples")
showitems()
Message("Initial Dictionary Items",output)
;oops made a mistake
d.Item("Italy") = "Rome"
showitems()
Message("Changed Capital of Italy",output)
d=0
Exit

:udfs
#DefineSubroutine showitems()
output=""
k=d.keys
i=d.Items
For j = 0 To d.Count - 1
    output=output:k[j]:",":i[j]:@CRLF
Next
Drop(k, i)
Return(output)
#EndSubroutine
Return
Stan - formerly stanl [ex-Pundit]