Fix typo with example variable name in Dictionary docs, and fix error in C# example

(cherry picked from commit 9359bee75c)
This commit is contained in:
zacryol 2021-09-25 19:57:29 -06:00 committed by Rémi Verschelde
parent 7c624b6b2b
commit 3e4e87fb90
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -29,7 +29,7 @@
some_key = 42,
}
[/codeblock]
You can access a dictionary's values by referencing the appropriate key. In the above example, [code]points_dir["White"][/code] will return [code]50[/code]. You can also write [code]points_dir.White[/code], which is equivalent. However, you'll have to use the bracket syntax if the key you're accessing the dictionary with isn't a fixed string (such as a number or variable).
You can access a dictionary's values by referencing the appropriate key. In the above example, [code]points_dict["White"][/code] will return [code]50[/code]. You can also write [code]points_dict.White[/code], which is equivalent. However, you'll have to use the bracket syntax if the key you're accessing the dictionary with isn't a fixed string (such as a number or variable).
[codeblock]
export(string, "White", "Yellow", "Orange") var my_color
var points_dict = {"White": 50, "Yellow": 75, "Orange": 100}
@ -50,7 +50,7 @@
Finally, dictionaries can contain different types of keys and values in the same dictionary:
[codeblock]
# This is a valid dictionary.
# To access the string "Nested value" below, use `my_dir.sub_dir.sub_key` or `my_dir["sub_dir"]["sub_key"]`.
# To access the string "Nested value" below, use `my_dict.sub_dict.sub_key` or `my_dict["sub_dict"]["sub_key"]`.
# Indexing styles can be mixed and matched depending on your needs.
var my_dict = {
"String Key": 5,