Associative List issue[Solved]
|
|
Code:
PageSort() var/num=1 var/list/L = RawData if(L.len>7)
world<<"Raw Data is [L.len]"
num=round((L.len/7)+1,1)
world<<"Raw Data is rounded to roughly [num] pages"
var/maxpage=num
winset(src,null,{" pagelabel.text = "1 of [maxpage]"; Loader.text = "Loading...."; "})
var/list/x=list()
for(var/i=1, i<maxpage+1, i++)
x=new()
for(var/j=7, j>0, j--)
if(!L[1]) return
x.Add(L[1])
L.Remove(L[1])
AsocList["[i]"]=x
var/i for(i in AsocList) world<<"Page [i] now has [AsocList[i]] items"
world<<"RawData now has [L.len] items left"
|
Problem description:
I'm getting a bad index runtime error when I try to run this code in game. The code is part of a system that generates pages with their own lists of items. I have looked around the forum and help files but cant find anything to explain why this error is coming up. Any help would be appreciated -Thanks
|