It's not a bug, it's a feature
You see this behaviour because you're using an index string that contains upper-case characters. When assigning table values using string indices, Hollywood actually does distinguish between upper and lower case characters, so the following lines all reference different table indices:
Code: Select all
t = {}
t["test"] = 1
t["Test"] = 2
t["TEST"] = 3
DebugPrint(t["test"], t["Test"], t["TEST"]) ; prints 1 2 3
This is an undocumented feature that has been there since Hollywood 2.0. The rationale behind it is that there are some cases where it might actually come in handy to have the possibility to access case sensitive variables. When using the normal dot assignment syntax, however, Hollywood will never be case sensitive, i.e.
Code: Select all
t = {}
t.test = 1
t.Test = 2
t.TEST = 3
DebugPrint(t.test, t.Test, t.TEST) ; prints 3 3 3
Internally, Hollywood will treat all those assignments as lower-case strings. Only when using string indices does Hollywood use case sensitivity.
So to fix your script, just do:
Code: Select all
TestTable1$={}
TestTable2$={}
TestTable1$["test"]=TestTable2$
DebugPrint(HaveItem(TestTable1$, "Test"))
HaveItem() only allows you to access lower-case string indices whereas RawGet() also allows access to mixed-case or upper-case string indices, hence the name RawGet().