IwReverseList

From InWorldz Wiki
Jump to: navigation, search

Scripting Wiki

InWorldz Functions | LSL Functions | Bot / NPC Functions | Events | Bot Events | Types | Operators | Constants | Flow Control | Glossary

function: list iwReverseList(list source, integer stride);

This function will take an input list, and then reverse the ordering of all elements, so an input of [1, 2, 3] will become [3, 2, 1]. The integer value stride, if set to more than one, will attempt to preserve the ordering of sub-elements within a strided list. So, if stride is 3 and the source list is [1, 2, 3, 4, 5, 6, 7, 8, 9], then the output list will be [7, 8, 9 ,4, 5, 6, 1, 2, 3]. If stride is more than one, then the input list must have a length that is a multiple of the stride, or else the function will throw an error and return an empty list.

Arguments
list source = The list which is to be reversed
integer stride = The length of strides within the list, if any.
Returns
list = a reversed list


Important Notes



Important Issues - View All - Search Mantis for related Bugs


Examples

//TODO

General Notes

See Also