I works like this, you have a variable and a variable array the only difrence is that it is easier to have one arrayed variable than several non arrayed ones(example - unit[n] where n is some number is easier to use than making n number of variables which aren't an array).
Now people figured that they can use this for indexing(indexing i think you know what means), so basicaly you only need to make sure that and index arrayed variable doesn't colide with itself, example:
index = 1
unit[index] = casting unit
You only need to make sure that this never hapens:
unit[index] = something
index = index - 1
That could screw up things, just take a look at the tutorial i wrote it's so easy, the guy calex3 learned to make MUI spells in less than a week with it...