Template:LSL Function/negative index/range

From Second Life Wiki
Jump to navigation Jump to search
Index Positive Negative
First 0 -length
Last length - 1 -1

Mentally first translate any negative indexes into positive indexes

  • If {{{1}}} <= {{{2}}} then the range operated on starts at {{{1}}} and ends at {{{2}}}. [{{{1}}}, {{{2}}}]
  • If {{{1}}} > {{{2}}} then the range operated on starts at {{{1}}} and ends at {{{2}}}. [0, {{{2}}}] + [{{{1}}}, -1]

See negative indexes for more information.