I'm trying to create an roList where each element is an roAssociativeArray. My ultimate goal is to have a list where each element is multiple roAssociativeArray's, but I figure if I can't get the simple case to work, the multiple roAssociativeArray issue is hopeless. Anyway, here's my code and its output. Can anybody see where I'm going wrong?
l = CreateObject("roList")
print "New list:";l.Count();" entries"
obj1 = CreateObject("roAssociativeArray")
obj1.str = "one"
obj1.num = 1
l.AddTail(obj1)
obj1.str = "two"
obj1.num = 2
l.AddTail(obj1)
obj1.str = "three"
obj1.num = 3
l.AddTail(obj1)
obj1.str = "four"
obj1.num = 4
l.AddTail(obj1)
print l.Count();" entries"
l.ResetIndex()
for each li in l
print li.str, li.num
end for
Output:
New list: 0 entries
4 entries
four 4
four 4
four 4
four 4
As you can see, all the entries are the same. The same thing happens if the GetHead() and GetTail() functions are used on the roList. Any help would be greatly appreciated.
-JT
Roku Community Streaming Expert
Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.
I am not a Roku employee.