Maybe check Mag's tutorial about vJASS Efficient Spell Models
[jass=]// You have two integer arrays:
integer array next
integer array prev
// You insert an instance of a missile in the linked list like this:
// We set the next one to this instance
// to 0 because it's going to be at the end // of the list
set next[index] = 0
// We set the one before this to prev[0],
// which represents the last instance in the list.
set prev[index] = prev[0]
// We set the next one to the last one, to this.
set next[prev[0]] = index
// We make this instance the last one.
set prev[0] = index
// You remove an instance of a missile from the linked list like this:
set next[prev[index]] = next[index]
set prev[next[index]] = prev[index]
// You loop over a linked list like this:
// next[0] is the first instance in the list
local integer currentMissile = next[0]
loop
// if the currentMissile is a null instance, then we stop.
exitwhen currentMissile == 0
// go to the next instance
set currentMissile = next[currentMissile]
endloop[/code]
an example of simple linked list