ScriptSpot

Forum topic · General Scripting

Skip first in array to array.count

By JokerMartini · 2011-08-07

Description

How would i affect just a portion of an array by skipping the first one.


testObjs = #()
for obj in selection do
(
appendIfUnique testObjs obj
)
newList = testObjs[3..(testObjs.count)]

Comments (2)

this one

Anubis · 2011-08-09

for i = 2 to selection.count do
	appendIfUnique testObjs selection[i]

but that also presume to watch to not get out of bound, i.e.

if selection.count >= 2 do -- start for loop

JokerMartini · 2011-08-09

I'm trying to affect all the object in the array except the first one.
Is there a simple way of listing all those items in skipping the first one and running through all the items in the array until there are no more.