Difference between revisions of "Template:LSL Function/negative index/single"

From Second Life Wiki
Jump to navigation Jump to search
m
m
Line 1: Line 1:
{{#if:
{{#if:


{{#vardefine:spec|{{#var:spec}}{{#if:{{#var:spec}}|<br/>|<span></span>}}
{{#vardefine:spec|{{#var:spec}}
{{{!}} {{Prettytable|style=float:left;}}
{{{!}} {{Prettytable|style=float:left;}}
{{!}}-{{Hl2}}
{{!}}-{{Hl2}}

Revision as of 17:03, 17 April 2009

#var value
p_index_desc
spec
Index Positive Negative
First 0 -length
Last length - 1 -1

Indexes

  • Positive indexes count from the beginning, the first item being indexed as 0, the last as (length - 1).
  • Negative indexes count from the far end, the first item being indexed as -length, the last as -1.
notes
caveats
  • If {{{1}}} is out of bounds the script continues to execute without an error message.