我认为您在第 5 行代码中出错了。您定义的变量没有 % 符号。
settings := {myColor: "color"}
myColor := "color"
settingName := "myColor"
settingValue := "0x00FF00"
settingName = %settingValue% ; Alternative 1
settingName := settingValue ; Alternative 2
settings[settingName] := settingValue
e := settings[settingName]
MsgBox % e " - " settings[settingName] " - " settingValue
;Displays 0x00FF00 - 0x00FF00 - 0x00FF00
ExitApp
虽然我认为您想要:Settings[MyColor] = 0x00FF00,但您现在拥有 Settings[0x00FF00] = 0x00FF00。
settings := {myColor: "color"}
myColor := "color"
settingName := "myColor"
settingValue := "0x00FF00"
settings[settingName] := settingValue
MsgBox % settings[settingName] " - " settingValue
;Displays 0x00FF00 - 0x00FF00
ExitApp