[SOLVED] Do you address child in structure by "NAME" or what is it?

In that example there was no need for the brackets and quotes. It works but it’s not needed.

aaa[“ccc”] is the same as aaa.ccc

With arrays you use
variableName[#] the # is the child or index

With structures you can use
variablesName.child or variableName[string]

When you use the brackets it’s for creating the child name dynamically. You wouldn’t usually use just text in quotes. You would add something after the quotes or instead of the quotes like another string variable name. Something that can be changed at runtime.

aaa.ccc or aaa[“ccc”]

Set temp to “ccc”
aaa[temp] (no quotes means variable)

Set string variable temp to “11”
aaa[“ccc” + temp]
(this would be the same as aaa.ccc11)

You can use a variable or an expression or any combination added together with a plus symbol. If it returns a number you would need to convert it to a string with ToString(#).

Number variable Temp=11
aaa[“ccc” + ToString(temp)
(this would be the same as aaa.ccc11)

You can use multiple dynamic child names. You can’t make dynamic variable names only the children. If you add brackets then you don’t need the period but if you use a child name not in brackets then you would use a period. It can get confusing. You wouldn’t normally use too many children. You would also use short but descriptive variable and child names.

aaa.ccc
aaa[“ccc”]
aaa[“ccc”].ddd
aaa[“ccc”][“ddd”]
aaa[“ccc”].ddd[“eee”].fff.ggg

And so on.

more realistic examples

Game[“level” + ToString(levelVariable])

Player.Name
Player.Ammo
Player.Weapons.pistol.Ammo
Player.Weapons.pistol.MaxAmmo
Player.Weapons.Shotgun.Ammo

To add to the confusion, you can have arrays of arrays, structures of structures, array of structures, structures of arrays or any other combination.