Difference between revisions of "Template:LSL Function/negative index/range"
Jump to navigation
Jump to search
m |
m (Undo revision 323193 by Strife Onizuka (Talk) i thought it worked but it didn't) |
||
Line 19: | Line 19: | ||
</div> | </div> | ||
The easiest way to work with negative indexes is to think of them in positive index form. | The easiest way to work with negative indexes is to think of them in positive index form. | ||
<div style="display: | <div style="display: table;"> | ||
*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}}}'''. ['''{{{1}}}''', '''{{{2}}}'''] | ||
*If '''{{{1}}}''' > '''{{{2}}}''' then the range operated on starts at '''0''' and goes to '''{{{2}}}''' and then starts again at '''{{{1}}}''' and goes to '''-1'''. ['''0''', '''{{{2}}}'''] + ['''{{{1}}}''', '''-1'''] | *If '''{{{1}}}''' > '''{{{2}}}''' then the range operated on starts at '''0''' and goes to '''{{{2}}}''' and then starts again at '''{{{1}}}''' and goes to '''-1'''. ['''0''', '''{{{2}}}'''] + ['''{{{1}}}''', '''-1'''] |
Revision as of 14:04, 17 April 2009
#var | value | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
p_start_desc | start index | |||||||||
p_end_desc | end index | |||||||||
spec |
The easiest way to work with negative indexes is to think of them in positive index form.
Positive indexes past the length (after the last index), or negative indexes past the beginning (before the first index) are valid. The effects are predictable, the entries are treated as if they were there but were removed just before output. See negative indexes for more information. |