Because
red is the
key here of the
key:value-pair,
1 is the value:
Code: Select all
Global F := {"red":1}
msgbox, 4096, Why?,% F["red"] ; returns 1
Via the (unique) keys, you can access the values (or you could loop through all pairs).
You could reverse current key and value, if you want "red" as the returned value.
F := {1:"red"} would be pretty much like the linear array
F := ["red"] - for the latter, the index/key is implicit.