Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

for loop usage of "by"

for loop usage of "by"

Anonymous
Not applicable
566 Views
1 Reply
Message 1 of 2

for loop usage of "by"

Anonymous
Not applicable
array1 = #("A", "B", "C")
array2 = #()
array3 = #()

--copying the array
array2 = for idx in array1 collect idx
--reversing the array
for idx = array1.count to 1 by -1 do (append array3 array1[idx])
In the above segment I looked in the reference manual for a maxscript for loop however I didn't get a very detailed explanation of what happens when the "by" operator is used? What does "by -1" mean? Could I get a detailed explanation of this usage please?
 
Thank You!
 
 
0 Likes
Accepted solutions (1)
567 Views
1 Reply
Reply (1)