Difference between revisions of "Template:LSL Function/list/element"

From Second Life Wiki
Jump to navigation Jump to search
m
m
Line 1: Line 1:
{{LSL_Function/negative index|true|{{{2|none}}}}}{{#if:
{{LSL_Function/negative index|true|{{{2|none_}}}}}{{#if:
{{#vardefine:p_{{{1|none}}}_desc|List containing the element of interest.}}
{{#vardefine:p_{{{1|none}}}_desc|List containing the element of interest.}}
{{#vardefine:p_{{{2|none}}}_desc|Index of the element of interest.}}
{{#vardefine:p_{{{2|none_}}}_desc|Index of the element of interest.}}
{{#vardefine:header_footnote|{{#if:{{{return|}}}|{{#if:{{#var:header_footnote}}|{{#var:header_footnote}}<br/>}}
{{#vardefine:header_footnote|{{#if:{{{return|}}}|{{#if:{{#var:header_footnote}}|{{#var:header_footnote}}<br/>}}
If '''{{{2|none}}}''' describes a location not in '''{{{1|none}}}''' then {{{return|}}} is returned.{{#if:{{{3|}}}|<br/>
If '''{{{2|none}}}''' describes a location not in '''{{{1|none}}}''' then {{{return|}}} is returned.{{#if:{{{3|}}}|<br/>
Line 8: Line 8:
Here is a workaround: <code>([[{{{3|}}}{{#var:lang}}|{{{3|}}}]])[[llList2String{{#var:lang}}|llList2String]]({{LSL Param|{{{1|none}}}}}, {{LSL Param|{{{2|none}}}}});</code>
Here is a workaround: <code>([[{{{3|}}}{{#var:lang}}|{{{3|}}}]])[[llList2String{{#var:lang}}|llList2String]]({{LSL Param|{{{1|none}}}}}, {{LSL Param|{{{2|none}}}}});</code>
|If the type of the element at '''{{{2|none}}}''' in '''{{{1|none}}}''' is not a [[{{{3|}}}{{#var:lang}}|{{{3|}}}]] it is [[typecast]] to a [[{{{3|}}}{{#var:lang}}|{{{3|}}}]]. {{#if:{{{nf|}}}||If it cannot be typecast {{{return|}}} is returned.}}}}}}|{{#var:header_footnote}}}}}}
|If the type of the element at '''{{{2|none}}}''' in '''{{{1|none}}}''' is not a [[{{{3|}}}{{#var:lang}}|{{{3|}}}]] it is [[typecast]] to a [[{{{3|}}}{{#var:lang}}|{{{3|}}}]]. {{#if:{{{nf|}}}||If it cannot be typecast {{{return|}}} is returned.}}}}}}|{{#var:header_footnote}}}}}}
}}<includeonly>{{LSLC|List/Read Element{{#var:lang}}}}</includeonly>
}}<includeonly>{{LSLC|List/Read Element{{#var:lang}}}}</includeonly><noinclude>
{| {{Prettytable}}
|-{{Hl2}}
! #var
! value
|-
{{VarPair|p_{{{1|none}}}_desc}}
|-
{{VarPair|p_{{{1|none_}}}_desc}}
|-
{{VarPair|header_footnote}}
|-
{{VarPair|spec}}
|-
{{VarPair|constants_nb}}
|-
{{VarPairTable|also_articles}}
|}
</noinclude>

Revision as of 05:54, 16 April 2009

#var value
p_none_desc List containing the element of interest.
p_none__desc Index of the element of interest.
header_footnote

none_ supports negative indexes.

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.
constants_nb
also_articles
•  Negative Index