I was hunting a bug in my code and, first, couldn't understand why it was a bug. Now, after tracing back the problem, i thought, i should write about it here, so others don't have to feel the same pain
The hollywood documentation says:
Code: Select all
You can access named elementes of a table also in two ways:
b = a["name"]
b = a.name
Both lines will assign the same value to b. The most common way to access and initialize named elements of a table is to use the dot method. *Please* *note* *that* *Hollywood* *does* *not* *distinguish* *between* *upper* *and* *lower* *case* *names*, so you could also access the elements above by using a.NAME or even a.nAmE"
For example:
Code: Select all
test = {}
test.myName = {}
Code: Select all
DebugPrint(RawGet(test,"myname")) --> True
DebugPrint(RawGet(test,"myName")) --> False
DebugPrint(test.myname) --> Table:
DebugPrint(test.myName) --> Table:
DebugPrint(test["myname"]) --> Table:
DebugPrint(test["myName"]) --> Error!
Code: Select all
test2={}
test2["myName"] = "blabla"
DebugPrint(test2["myName"]) --> "blabla"
DebugPrint(test2["myname"]) --> Error!
Code: Select all
DebugPrint(test2.myname) --> Error!
DebugPrint(test2.myName) --> Error!
Dunno, if this is a bug in the documentation or in Hollywood 4.5
regards, Tom