ID:1893726
 
(See the best response by Mar big.)
Problem description:
So what i'm trying to do is display a list of icon states within a icon.
Code:
 var/list/iconstates=icon_states('Skills.dmi')
var/list/Entity=list()
for(var/i=0, i<=iconstates.len,i++)
// world << i
// world << "[iconstate[i]]"
var/Entity/C=new
C.icon='Skills.dmi'
C.icon_state="[iconstates[i]]"
Entity.Add(C)

However it keeps on saying the list is out of bounds :\

Best response
Dream Maker isn't a 0 indexing language, i should start at 1.
Ah thank you it works fine now !!!!
FYI that common for() can be written in this more efficient and readable form:
for(var/i in 1 to iconstates.len)


Although, at this point, you might as well be looping through the states themselves, rather than the list indices:
for(var/state in icon_states('Skills.dmi'))
// etc.
C.icon_state = state