Data
var/list/Cache
proc/Add2Cache(text)
if(!Cache)
Cache=list()
if(!Cache["Test"])
Cache.Add("Test")
Cache["Test"] += text
var/Data/Data = new
mob/verb
Cache_Add(t as text)
Data.Add2Cache(t)
Now this is obviously not the same context I'm using, but it is fundamentally the same. Why can't I check the contents of Data.Cache["Test"] with something like:
mob/verb
CheckData()
for(var/a in Data.Cache["Test"])
world<<a
I'm assuming by how you want to access the data, you intend Cache["Test"] to point to a list?
You can verify this with:
world << Cache["Test"]
if you want to add individual strings to a list, you'd have to initialize Cache["Test"] as a list, like: