I doubt the speed will matter but you will get different results.
I'll use letters to avoid confusing the objects with their position in the list. (And the list will start at 1, for simplicity). I'm also assuming you draw the first object of a list first, and move in a forward direction. (In that case the object at the end of the list is drawn last and so on top. Tonyg might be doing it the wrong way round by adding the object to the start of the list, but the principle is the same.)
Let's say you have objects A to E, with 1 being behind and 5 in front. If you want C to be in front, using the list method C will be plucked from its location at 3 and stored in a temp variable. The rest of the list will now update so D is now in 3, E is now in 4 and 5 is empty. Now C is added to the end of the list at 5. The final order is thus A B D E C
Unlike lists, the elements of an array do not (automatically) update themselves when elements are added or remove. So if you had objects A to E in 1 to 5 again, and you removed C to a temp variable from 3. 3 is now empty, and D remains in 4 and E remains in 5. Now you cut and paste 5 into 3 to fill the gap, and put C into 5. Essentially you have swapped C and E in the array. The final order is thus A B E D C
Either method will work for putting the current object on top. THe question is whether the order of the objects not on top counts. If not, use whichever method you find easiest.
Here's a question for you... which method does Windows use for its windows? (Or seem to use anyway)
I'll use letters to avoid confusing the objects with their position in the list. (And the list will start at 1, for simplicity). I'm also assuming you draw the first object of a list first, and move in a forward direction. (In that case the object at the end of the list is drawn last and so on top. Tonyg might be doing it the wrong way round by adding the object to the start of the list, but the principle is the same.)
Let's say you have objects A to E, with 1 being behind and 5 in front. If you want C to be in front, using the list method C will be plucked from its location at 3 and stored in a temp variable. The rest of the list will now update so D is now in 3, E is now in 4 and 5 is empty. Now C is added to the end of the list at 5. The final order is thus A B D E C
Unlike lists, the elements of an array do not (automatically) update themselves when elements are added or remove. So if you had objects A to E in 1 to 5 again, and you removed C to a temp variable from 3. 3 is now empty, and D remains in 4 and E remains in 5. Now you cut and paste 5 into 3 to fill the gap, and put C into 5. Essentially you have swapped C and E in the array. The final order is thus A B E D C
Either method will work for putting the current object on top. THe question is whether the order of the objects not on top counts. If not, use whichever method you find easiest.
Here's a question for you... which method does Windows use for its windows? (Or seem to use anyway)