<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.secondlife.com/w/index.php?action=history&amp;feed=atom&amp;title=LlListSortStrided</id>
	<title>LlListSortStrided - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.secondlife.com/w/index.php?action=history&amp;feed=atom&amp;title=LlListSortStrided"/>
	<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LlListSortStrided&amp;action=history"/>
	<updated>2026-07-28T07:29:22Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LlListSortStrided&amp;diff=1217478&amp;oldid=prev</id>
		<title>Tapple Gao: s/sort/sorting algorithm/</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LlListSortStrided&amp;diff=1217478&amp;oldid=prev"/>
		<updated>2024-10-07T18:12:57Z</updated>

		<summary type="html">&lt;p&gt;s/sort/sorting algorithm/&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 11:12, 7 October 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l33&quot;&gt;Line 33:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 33:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* When strings contain numbers, the numbers are still sorted left-to-right like any other character, which may not necessarily match numeric order: &amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;llListSortStrided([&amp;quot;127&amp;quot;, &amp;quot;3&amp;quot;, &amp;quot;25&amp;quot;], 1, 0, TRUE) // returns [&amp;quot;127&amp;quot;, &amp;quot;25&amp;quot;, &amp;quot;3&amp;quot;] because the 1 in 127 is before the 2 in 25 which is before the 3&amp;lt;/source&amp;gt; To sort them in numeric order, numbers in strings can be padded with zeros: &amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;llListSortStrided([&amp;quot;127&amp;quot;, &amp;quot;003&amp;quot;, &amp;quot;025&amp;quot;], 1, 0, TRUE) // returns [&amp;quot;003&amp;quot;, &amp;quot;025&amp;quot;, &amp;quot;127&amp;quot;]&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* When strings contain numbers, the numbers are still sorted left-to-right like any other character, which may not necessarily match numeric order: &amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;llListSortStrided([&amp;quot;127&amp;quot;, &amp;quot;3&amp;quot;, &amp;quot;25&amp;quot;], 1, 0, TRUE) // returns [&amp;quot;127&amp;quot;, &amp;quot;25&amp;quot;, &amp;quot;3&amp;quot;] because the 1 in 127 is before the 2 in 25 which is before the 3&amp;lt;/source&amp;gt; To sort them in numeric order, numbers in strings can be padded with zeros: &amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;llListSortStrided([&amp;quot;127&amp;quot;, &amp;quot;003&amp;quot;, &amp;quot;025&amp;quot;], 1, 0, TRUE) // returns [&amp;quot;003&amp;quot;, &amp;quot;025&amp;quot;, &amp;quot;127&amp;quot;]&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** This order differs from the order of items in a prim&amp;#039;s inventory, which is &amp;quot;natural order&amp;quot; (e.g &amp;quot;New Script 2&amp;quot; is sorted before &amp;quot;New Script 11&amp;quot;).&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** This order differs from the order of items in a prim&amp;#039;s inventory, which is &amp;quot;natural order&amp;quot; (e.g &amp;quot;New Script 2&amp;quot; is sorted before &amp;quot;New Script 11&amp;quot;).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;sort &lt;/del&gt;is not [https://en.wikipedia.org/wiki/Sorting_algorithm#Stability stable]. Thus you cannot use 2 sorts on different columns to sort by multiple keys: &amp;lt;source lang=&quot;lsl2&quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;sorting algorithm &lt;/ins&gt;is not [https://en.wikipedia.org/wiki/Sorting_algorithm#Stability stable]. Thus you cannot use 2 sorts on different columns to sort by multiple keys: &amp;lt;source lang=&quot;lsl2&quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;default { state_entry() { // THIS DOES NOT WORK AS A MULTI-KEY SORT&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;default { state_entry() { // THIS DOES NOT WORK AS A MULTI-KEY SORT&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     list input = [1, &amp;quot;b&amp;quot;, 0, &amp;quot;c&amp;quot;, 1, &amp;quot;a&amp;quot;, 0, &amp;quot;b&amp;quot;, 1, &amp;quot;c&amp;quot;, 0, &amp;quot;a&amp;quot;];&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     list input = [1, &amp;quot;b&amp;quot;, 0, &amp;quot;c&amp;quot;, 1, &amp;quot;a&amp;quot;, 0, &amp;quot;b&amp;quot;, 1, &amp;quot;c&amp;quot;, 0, &amp;quot;a&amp;quot;];&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Tapple Gao</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LlListSortStrided&amp;diff=1217477&amp;oldid=prev</id>
		<title>Tapple Gao: shortened the multi-key non-example</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LlListSortStrided&amp;diff=1217477&amp;oldid=prev"/>
		<updated>2024-10-07T18:11:49Z</updated>

		<summary type="html">&lt;p&gt;shortened the multi-key non-example&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 11:11, 7 October 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l34&quot;&gt;Line 34:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 34:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** This order differs from the order of items in a prim&amp;#039;s inventory, which is &amp;quot;natural order&amp;quot; (e.g &amp;quot;New Script 2&amp;quot; is sorted before &amp;quot;New Script 11&amp;quot;).&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** This order differs from the order of items in a prim&amp;#039;s inventory, which is &amp;quot;natural order&amp;quot; (e.g &amp;quot;New Script 2&amp;quot; is sorted before &amp;quot;New Script 11&amp;quot;).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The sort is not [https://en.wikipedia.org/wiki/Sorting_algorithm#Stability stable]. Thus you cannot use 2 sorts on different columns to sort by multiple keys: &amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The sort is not [https://en.wikipedia.org/wiki/Sorting_algorithm#Stability stable]. Thus you cannot use 2 sorts on different columns to sort by multiple keys: &amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;default { // THIS DOES NOT WORK AS A MULTI-KEY SORT&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;default &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{ state_entry() &lt;/ins&gt;{ // THIS DOES NOT WORK AS A MULTI-KEY SORT&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;state_entry() {&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     list input = [1, &quot;b&quot;, 0, &quot;c&quot;, 1, &quot;a&quot;, 0, &quot;b&quot;, 1, &quot;c&quot;, 0, &quot;a&quot;];&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        &lt;/del&gt;list input = [1, &quot;b&quot;, 0, &quot;c&quot;, 1, &quot;a&quot;, 0, &quot;b&quot;, 1, &quot;c&quot;, 0, &quot;a&quot;];&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    &lt;/ins&gt;list partialSort = llListSortStrided(input, 2, 1, TRUE);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        &lt;/del&gt;list partialSort = llListSortStrided(input, 2, 1, TRUE);&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    &lt;/ins&gt;llOwnerSay(&quot;partialSort = &quot; + llList2Json(JSON_ARRAY, partialSort));&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        &lt;/del&gt;llOwnerSay(&quot;partialSort = &quot; + llList2Json(JSON_ARRAY, partialSort));&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    &lt;/ins&gt;list fullSort = llListSortStrided(partialSort, 2, 0, TRUE);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        &lt;/del&gt;list fullSort = llListSortStrided(partialSort, 2, 0, TRUE);&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    &lt;/ins&gt;llOwnerSay(&quot;fullSort = &quot; + llList2Json(JSON_ARRAY, fullSort));&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        &lt;/del&gt;llOwnerSay(&quot;fullSort = &quot; + llList2Json(JSON_ARRAY, fullSort));&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;} }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    &lt;/del&gt;}&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;}&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;This gives the following output (errors bolded):&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;This gives the following output (errors bolded):&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** partialSort = [1,&amp;quot;a&amp;quot;,0,&amp;quot;a&amp;quot;,&amp;#039;&amp;#039;&amp;#039;0,&amp;#039;&amp;#039;&amp;#039;&amp;quot;b&amp;quot;,&amp;#039;&amp;#039;&amp;#039;1,&amp;#039;&amp;#039;&amp;#039;&amp;quot;b&amp;quot;,&amp;#039;&amp;#039;&amp;#039;1,&amp;#039;&amp;#039;&amp;#039;&amp;quot;c&amp;quot;,&amp;#039;&amp;#039;&amp;#039;0,&amp;#039;&amp;#039;&amp;#039;&amp;quot;c&amp;quot;]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** partialSort = [1,&amp;quot;a&amp;quot;,0,&amp;quot;a&amp;quot;,&amp;#039;&amp;#039;&amp;#039;0,&amp;#039;&amp;#039;&amp;#039;&amp;quot;b&amp;quot;,&amp;#039;&amp;#039;&amp;#039;1,&amp;#039;&amp;#039;&amp;#039;&amp;quot;b&amp;quot;,&amp;#039;&amp;#039;&amp;#039;1,&amp;#039;&amp;#039;&amp;#039;&amp;quot;c&amp;quot;,&amp;#039;&amp;#039;&amp;#039;0,&amp;#039;&amp;#039;&amp;#039;&amp;quot;c&amp;quot;]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Tapple Gao</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LlListSortStrided&amp;diff=1217476&amp;oldid=prev</id>
		<title>Tapple Gao: added wikipedia link to sort stability, rather than trying to explain it here</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LlListSortStrided&amp;diff=1217476&amp;oldid=prev"/>
		<updated>2024-10-07T18:08:43Z</updated>

		<summary type="html">&lt;p&gt;added wikipedia link to sort stability, rather than trying to explain it here&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 11:08, 7 October 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l33&quot;&gt;Line 33:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 33:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* When strings contain numbers, the numbers are still sorted left-to-right like any other character, which may not necessarily match numeric order: &amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;llListSortStrided([&amp;quot;127&amp;quot;, &amp;quot;3&amp;quot;, &amp;quot;25&amp;quot;], 1, 0, TRUE) // returns [&amp;quot;127&amp;quot;, &amp;quot;25&amp;quot;, &amp;quot;3&amp;quot;] because the 1 in 127 is before the 2 in 25 which is before the 3&amp;lt;/source&amp;gt; To sort them in numeric order, numbers in strings can be padded with zeros: &amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;llListSortStrided([&amp;quot;127&amp;quot;, &amp;quot;003&amp;quot;, &amp;quot;025&amp;quot;], 1, 0, TRUE) // returns [&amp;quot;003&amp;quot;, &amp;quot;025&amp;quot;, &amp;quot;127&amp;quot;]&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* When strings contain numbers, the numbers are still sorted left-to-right like any other character, which may not necessarily match numeric order: &amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;llListSortStrided([&amp;quot;127&amp;quot;, &amp;quot;3&amp;quot;, &amp;quot;25&amp;quot;], 1, 0, TRUE) // returns [&amp;quot;127&amp;quot;, &amp;quot;25&amp;quot;, &amp;quot;3&amp;quot;] because the 1 in 127 is before the 2 in 25 which is before the 3&amp;lt;/source&amp;gt; To sort them in numeric order, numbers in strings can be padded with zeros: &amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;llListSortStrided([&amp;quot;127&amp;quot;, &amp;quot;003&amp;quot;, &amp;quot;025&amp;quot;], 1, 0, TRUE) // returns [&amp;quot;003&amp;quot;, &amp;quot;025&amp;quot;, &amp;quot;127&amp;quot;]&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** This order differs from the order of items in a prim&amp;#039;s inventory, which is &amp;quot;natural order&amp;quot; (e.g &amp;quot;New Script 2&amp;quot; is sorted before &amp;quot;New Script 11&amp;quot;).&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** This order differs from the order of items in a prim&amp;#039;s inventory, which is &amp;quot;natural order&amp;quot; (e.g &amp;quot;New Script 2&amp;quot; is sorted before &amp;quot;New Script 11&amp;quot;).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The sort is not stable&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;; if the sort key matches, the input list&#039;s order is not preserved&lt;/del&gt;. Thus you cannot use 2 sorts on different columns to sort by multiple keys: &amp;lt;source lang=&quot;lsl2&quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The sort is not &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[https://en.wikipedia.org/wiki/Sorting_algorithm#Stability &lt;/ins&gt;stable&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]&lt;/ins&gt;. Thus you cannot use 2 sorts on different columns to sort by multiple keys: &amp;lt;source lang=&quot;lsl2&quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;default { // THIS DOES NOT WORK AS A MULTI-KEY SORT&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;default { // THIS DOES NOT WORK AS A MULTI-KEY SORT&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     state_entry() {&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     state_entry() {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Tapple Gao</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LlListSortStrided&amp;diff=1217475&amp;oldid=prev</id>
		<title>Tapple Gao: Added a caveat that the sort is not stable</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LlListSortStrided&amp;diff=1217475&amp;oldid=prev"/>
		<updated>2024-10-07T18:05:51Z</updated>

		<summary type="html">&lt;p&gt;Added a caveat that the sort is not stable&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 11:05, 7 October 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l33&quot;&gt;Line 33:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 33:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* When strings contain numbers, the numbers are still sorted left-to-right like any other character, which may not necessarily match numeric order: &amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;llListSortStrided([&amp;quot;127&amp;quot;, &amp;quot;3&amp;quot;, &amp;quot;25&amp;quot;], 1, 0, TRUE) // returns [&amp;quot;127&amp;quot;, &amp;quot;25&amp;quot;, &amp;quot;3&amp;quot;] because the 1 in 127 is before the 2 in 25 which is before the 3&amp;lt;/source&amp;gt; To sort them in numeric order, numbers in strings can be padded with zeros: &amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;llListSortStrided([&amp;quot;127&amp;quot;, &amp;quot;003&amp;quot;, &amp;quot;025&amp;quot;], 1, 0, TRUE) // returns [&amp;quot;003&amp;quot;, &amp;quot;025&amp;quot;, &amp;quot;127&amp;quot;]&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* When strings contain numbers, the numbers are still sorted left-to-right like any other character, which may not necessarily match numeric order: &amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;llListSortStrided([&amp;quot;127&amp;quot;, &amp;quot;3&amp;quot;, &amp;quot;25&amp;quot;], 1, 0, TRUE) // returns [&amp;quot;127&amp;quot;, &amp;quot;25&amp;quot;, &amp;quot;3&amp;quot;] because the 1 in 127 is before the 2 in 25 which is before the 3&amp;lt;/source&amp;gt; To sort them in numeric order, numbers in strings can be padded with zeros: &amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;llListSortStrided([&amp;quot;127&amp;quot;, &amp;quot;003&amp;quot;, &amp;quot;025&amp;quot;], 1, 0, TRUE) // returns [&amp;quot;003&amp;quot;, &amp;quot;025&amp;quot;, &amp;quot;127&amp;quot;]&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** This order differs from the order of items in a prim&amp;#039;s inventory, which is &amp;quot;natural order&amp;quot; (e.g &amp;quot;New Script 2&amp;quot; is sorted before &amp;quot;New Script 11&amp;quot;).&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** This order differs from the order of items in a prim&amp;#039;s inventory, which is &amp;quot;natural order&amp;quot; (e.g &amp;quot;New Script 2&amp;quot; is sorted before &amp;quot;New Script 11&amp;quot;).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* The sort is not stable; if the sort key matches, the input list&#039;s order is not preserved. Thus you cannot use 2 sorts on different columns to sort by multiple keys: &amp;lt;source lang=&quot;lsl2&quot;&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;default { // THIS DOES NOT WORK AS A MULTI-KEY SORT&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    state_entry() {&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        list input = [1, &quot;b&quot;, 0, &quot;c&quot;, 1, &quot;a&quot;, 0, &quot;b&quot;, 1, &quot;c&quot;, 0, &quot;a&quot;];&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        list partialSort = llListSortStrided(input, 2, 1, TRUE);&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        llOwnerSay(&quot;partialSort = &quot; + llList2Json(JSON_ARRAY, partialSort));&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        list fullSort = llListSortStrided(partialSort, 2, 0, TRUE);&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;        llOwnerSay(&quot;fullSort = &quot; + llList2Json(JSON_ARRAY, fullSort));&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;    }&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/source&amp;gt;This gives the following output (errors bolded):&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;** partialSort = [1,&quot;a&quot;,0,&quot;a&quot;,&#039;&#039;&#039;0,&#039;&#039;&#039;&quot;b&quot;,&#039;&#039;&#039;1,&#039;&#039;&#039;&quot;b&quot;,&#039;&#039;&#039;1,&#039;&#039;&#039;&quot;c&quot;,&#039;&#039;&#039;0,&#039;&#039;&#039;&quot;c&quot;]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;** fullSort = [0,&quot;a&quot;,0,&quot;b&quot;,0,&quot;c&quot;,1,&#039;&#039;&#039;&quot;b&quot;,&#039;&#039;&#039;1,&#039;&#039;&#039;&quot;c&quot;,&#039;&#039;&#039;1,&#039;&#039;&#039;&quot;a&quot;&#039;&#039;&#039;]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|constants&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|constants&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|examples=&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|examples=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Tapple Gao</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LlListSortStrided&amp;diff=1216499&amp;oldid=prev</id>
		<title>Sei Lisa: Add caveat, add info on negative stride, fix typo in example</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LlListSortStrided&amp;diff=1216499&amp;oldid=prev"/>
		<updated>2024-04-19T13:14:05Z</updated>

		<summary type="html">&lt;p&gt;Add caveat, add info on negative stride, fix typo in example&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 06:14, 19 April 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l6&quot;&gt;Line 6:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 6:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|p1_type=list|p1_name=src|p1_desc=List to be sorted.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|p1_type=list|p1_name=src|p1_desc=List to be sorted.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|p2_type=integer|p2_name=stride&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|p2_type=integer|p2_name=stride&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|p3_type=integer|p3_name=stride_index|p3_desc=The index within the stride to sort by. stride_index is 0-indexed. The first element is 0, second 1, etc. An index of 0 is functionally identical to using [[llListSort]].&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|p3_type=integer|p3_name=stride_index|p3_desc=The index within the stride to sort by. stride_index is 0-indexed. The first element is 0, second 1, etc. An index of 0 is functionally identical to using [[llListSort]]&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;. Negative indexes count from the end of the stride, e.g. -1 means the last element in the stride&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|p4_type=integer|p4_name=ascending|p4_desc=if [[TRUE]] then the sort order is ascending, otherwise the order is descending.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|p4_type=integer|p4_name=ascending|p4_desc=if [[TRUE]] then the sort order is ascending, otherwise the order is descending.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|func_footnote&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|func_footnote&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l12&quot;&gt;Line 12:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 12:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|return_text=that is {{LSLP|src}} sorted by the {{LSLP|stride_index}} item in every {{LSLP|stride}}.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|return_text=that is {{LSLP|src}} sorted by the {{LSLP|stride_index}} item in every {{LSLP|stride}}.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|spec=The sort order is affected by type. For strings and keys, it is case sensitive and sorts by Unicode character code.&amp;lt;br/&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|spec=The sort order is affected by type. For strings and keys, it is case sensitive and sorts by Unicode character code.&amp;lt;br/&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;source lang=&quot;lsl2&quot;&amp;gt;llListSortStrided([&quot;a&quot;, &quot;á&quot;, &quot;B&quot;, &quot;C&quot;, &quot;d&quot;, &quot;e&quot;], 1, 0 TRUE) // returns [&quot;B&quot;, &quot;C&quot;, &quot;a&quot;, &quot;d&quot;, &quot;e&quot;, &quot;á&quot;]&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;source lang=&quot;lsl2&quot;&amp;gt;llListSortStrided([&quot;a&quot;, &quot;á&quot;, &quot;B&quot;, &quot;C&quot;, &quot;d&quot;, &quot;e&quot;], 1, 0&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;, &lt;/ins&gt;TRUE) // returns [&quot;B&quot;, &quot;C&quot;, &quot;a&quot;, &quot;d&quot;, &quot;e&quot;, &quot;á&quot;]&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;For ascending sort, each type is sorted individually and then feathered to have the same order of types.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;For ascending sort, each type is sorted individually and then feathered to have the same order of types.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l30&quot;&gt;Line 30:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 30:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* For descending sort, if there are mixed types, the final order is deterministic (the same input will always produce the same output) but it can be completely useless. &amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;llListSortStrided([2, &amp;quot;B&amp;quot;, &amp;quot;C&amp;quot;, 3, 1, &amp;quot;A&amp;quot;], 1, 0, FALSE) // returns [&amp;quot;A&amp;quot;, 3, 1, &amp;quot;C&amp;quot;, &amp;quot;B&amp;quot;, 2]&amp;lt;/source&amp;gt; If there are no mixed types, however, the descending sort works just fine.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* For descending sort, if there are mixed types, the final order is deterministic (the same input will always produce the same output) but it can be completely useless. &amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;llListSortStrided([2, &amp;quot;B&amp;quot;, &amp;quot;C&amp;quot;, 3, 1, &amp;quot;A&amp;quot;], 1, 0, FALSE) // returns [&amp;quot;A&amp;quot;, 3, 1, &amp;quot;C&amp;quot;, &amp;quot;B&amp;quot;, 2]&amp;lt;/source&amp;gt; If there are no mixed types, however, the descending sort works just fine.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* When the stride is greater than 1, if the list length is not a multiple of the stride, the list will be returned unchanged.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* When the stride is greater than 1, if the list length is not a multiple of the stride, the list will be returned unchanged.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* stride_index must be less than stride and greater than or equal to -stride, otherwise an empty list is returned.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* When strings contain numbers, the numbers are still sorted left-to-right like any other character, which may not necessarily match numeric order: &amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;llListSortStrided([&amp;quot;127&amp;quot;, &amp;quot;3&amp;quot;, &amp;quot;25&amp;quot;], 1, 0, TRUE) // returns [&amp;quot;127&amp;quot;, &amp;quot;25&amp;quot;, &amp;quot;3&amp;quot;] because the 1 in 127 is before the 2 in 25 which is before the 3&amp;lt;/source&amp;gt; To sort them in numeric order, numbers in strings can be padded with zeros: &amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;llListSortStrided([&amp;quot;127&amp;quot;, &amp;quot;003&amp;quot;, &amp;quot;025&amp;quot;], 1, 0, TRUE) // returns [&amp;quot;003&amp;quot;, &amp;quot;025&amp;quot;, &amp;quot;127&amp;quot;]&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* When strings contain numbers, the numbers are still sorted left-to-right like any other character, which may not necessarily match numeric order: &amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;llListSortStrided([&amp;quot;127&amp;quot;, &amp;quot;3&amp;quot;, &amp;quot;25&amp;quot;], 1, 0, TRUE) // returns [&amp;quot;127&amp;quot;, &amp;quot;25&amp;quot;, &amp;quot;3&amp;quot;] because the 1 in 127 is before the 2 in 25 which is before the 3&amp;lt;/source&amp;gt; To sort them in numeric order, numbers in strings can be padded with zeros: &amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;llListSortStrided([&amp;quot;127&amp;quot;, &amp;quot;003&amp;quot;, &amp;quot;025&amp;quot;], 1, 0, TRUE) // returns [&amp;quot;003&amp;quot;, &amp;quot;025&amp;quot;, &amp;quot;127&amp;quot;]&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** This order differs from the order of items in a prim&amp;#039;s inventory, which is &amp;quot;natural order&amp;quot; (e.g &amp;quot;New Script 2&amp;quot; is sorted before &amp;quot;New Script 11&amp;quot;).&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** This order differs from the order of items in a prim&amp;#039;s inventory, which is &amp;quot;natural order&amp;quot; (e.g &amp;quot;New Script 2&amp;quot; is sorted before &amp;quot;New Script 11&amp;quot;).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Sei Lisa</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LlListSortStrided&amp;diff=1214215&amp;oldid=prev</id>
		<title>Lou Netizen: Cleaned up formatting; no content changes</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LlListSortStrided&amp;diff=1214215&amp;oldid=prev"/>
		<updated>2023-07-06T00:02:14Z</updated>

		<summary type="html">&lt;p&gt;Cleaned up formatting; no content changes&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:02, 5 July 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l6&quot;&gt;Line 6:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 6:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|p1_type=list|p1_name=src|p1_desc=List to be sorted.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|p1_type=list|p1_name=src|p1_desc=List to be sorted.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|p2_type=integer|p2_name=stride&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|p2_type=integer|p2_name=stride&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|p3_type=integer|p3_name=stride_index|p3_desc=The index within the stride to sort by. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;stride_index is 0-indexed. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;The first element is 0, second 1, etc. An index of 0 is functionally identical to using llListSort&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|p3_type=integer|p3_name=stride_index|p3_desc=The index within the stride to sort by. stride_index is 0-indexed. The first element is 0, second 1, etc. An index of 0 is functionally identical to using &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[&lt;/ins&gt;llListSort&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]].&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|p4_type=integer|p4_name=ascending|&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;p3_desc&lt;/del&gt;=if [[TRUE]] then the sort order is ascending, otherwise the order is descending.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|p4_type=integer|p4_name=ascending|&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;p4_desc&lt;/ins&gt;=if [[TRUE]] then the sort order is ascending, otherwise the order is descending.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|func_footnote&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|func_footnote&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|func_desc=llListSortStrided is llListSort with the added parameter of stride_index, adding the flexibility to sort by any item in the stride.  These routines use the same underlying code and have the same computational complexity.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|func_desc=llListSortStrided is llListSort with the added parameter of stride_index, adding the flexibility to sort by any item in the stride.  These routines use the same underlying code and have the same computational complexity.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l21&quot;&gt;Line 21:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 21:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;llListSortStrided([1, &amp;quot;C&amp;quot;, 3, &amp;quot;A&amp;quot;, 2, &amp;quot;B&amp;quot;], 2, 0, TRUE) // returns [1, &amp;quot;C&amp;quot;, 2, &amp;quot;B&amp;quot;, 3, &amp;quot;A&amp;quot;]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;llListSortStrided([1, &amp;quot;C&amp;quot;, 3, &amp;quot;A&amp;quot;, 2, &amp;quot;B&amp;quot;], 2, 0, TRUE) // returns [1, &amp;quot;C&amp;quot;, 2, &amp;quot;B&amp;quot;, 3, &amp;quot;A&amp;quot;]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;llListSortStrided([1, &quot;C&quot;, 3, &quot;A&quot;, 2, &quot;B&quot;], 2, 1, TRUE) // returns [3, &quot;A&quot;, 2, &quot;B&quot;, 1, &quot;C&quot;]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;llListSortStrided([1, &quot;C&quot;, 3, &quot;A&quot;, 2, &quot;B&quot;], 2, 1, TRUE) // returns [3, &quot;A&quot;, 2, &quot;B&quot;, 1, &quot;C&quot;]&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/source&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Lou Netizen</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LlListSortStrided&amp;diff=1213854&amp;oldid=prev</id>
		<title>Aura Linden at 23:54, 5 April 2023</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LlListSortStrided&amp;diff=1213854&amp;oldid=prev"/>
		<updated>2023-04-05T23:54:12Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:54, 5 April 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l9&quot;&gt;Line 9:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 9:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|p4_type=integer|p4_name=ascending|p3_desc=if [[TRUE]] then the sort order is ascending, otherwise the order is descending.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|p4_type=integer|p4_name=ascending|p3_desc=if [[TRUE]] then the sort order is ascending, otherwise the order is descending.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|func_footnote&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|func_footnote&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|func_desc=llListSortStrided is llListSort with the added parameter of stride_index, adding the flexibility to sort by any item in the stride.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|func_desc=llListSortStrided is llListSort with the added parameter of stride_index, adding the flexibility to sort by any item in the stride&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;.  These routines use the same underlying code and have the same computational complexity&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|return_text=that is {{LSLP|src}} sorted by the {{LSLP|stride_index}} item in every {{LSLP|stride}}.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|return_text=that is {{LSLP|src}} sorted by the {{LSLP|stride_index}} item in every {{LSLP|stride}}.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|spec=The sort order is affected by type. For strings and keys, it is case sensitive and sorts by Unicode character code.&amp;lt;br/&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|spec=The sort order is affected by type. For strings and keys, it is case sensitive and sorts by Unicode character code.&amp;lt;br/&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l28&quot;&gt;Line 28:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 28:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[Vector]]s are sorted by magnitude. {{Jira|SVC-5643}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[Vector]]s are sorted by magnitude. {{Jira|SVC-5643}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[Rotation]]s are not sorted in any meaningful order. If a list containing only rotations is sorted in ascending order, it will be returned unchanged.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [[Rotation]]s are not sorted in any meaningful order. If a list containing only rotations is sorted in ascending order, it will be returned unchanged.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* For descending sort, if there are mixed types, the final order is deterministic (the same input will always produce the same output) but it can be completely useless. &amp;lt;source lang=&quot;lsl2&quot;&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;llListSort&lt;/del&gt;([2, &quot;B&quot;, &quot;C&quot;, 3, 1, &quot;A&quot;], 1, FALSE) // returns [&quot;A&quot;, 3, 1, &quot;C&quot;, &quot;B&quot;, 2]&amp;lt;/source&amp;gt; If there are no mixed types, however, the descending sort works just fine.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* For descending sort, if there are mixed types, the final order is deterministic (the same input will always produce the same output) but it can be completely useless. &amp;lt;source lang=&quot;lsl2&quot;&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;llListSortStrided&lt;/ins&gt;([2, &quot;B&quot;, &quot;C&quot;, 3, 1, &quot;A&quot;], 1&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;, 0&lt;/ins&gt;, FALSE) // returns [&quot;A&quot;, 3, 1, &quot;C&quot;, &quot;B&quot;, 2]&amp;lt;/source&amp;gt; If there are no mixed types, however, the descending sort works just fine.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* When the stride is greater than 1, if the list length is not a multiple of the stride, the list will be returned unchanged.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* When the stride is greater than 1, if the list length is not a multiple of the stride, the list will be returned unchanged.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* When strings contain numbers, the numbers are still sorted left-to-right like any other character, which may not necessarily match numeric order: &amp;lt;source lang=&quot;lsl2&quot;&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;llListSort&lt;/del&gt;([&quot;127&quot;, &quot;3&quot;, &quot;25&quot;], 1, TRUE) // returns [&quot;127&quot;, &quot;25&quot;, &quot;3&quot;] because the 1 in 127 is before the 2 in 25 which is before the 3&amp;lt;/source&amp;gt; To sort them in numeric order, numbers in strings can be padded with zeros: &amp;lt;source lang=&quot;lsl2&quot;&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;llListSort&lt;/del&gt;([&quot;127&quot;, &quot;003&quot;, &quot;025&quot;], 1, TRUE) // returns [&quot;003&quot;, &quot;025&quot;, &quot;127&quot;]&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* When strings contain numbers, the numbers are still sorted left-to-right like any other character, which may not necessarily match numeric order: &amp;lt;source lang=&quot;lsl2&quot;&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;llListSortStrided&lt;/ins&gt;([&quot;127&quot;, &quot;3&quot;, &quot;25&quot;], 1&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;, 0&lt;/ins&gt;, TRUE) // returns [&quot;127&quot;, &quot;25&quot;, &quot;3&quot;] because the 1 in 127 is before the 2 in 25 which is before the 3&amp;lt;/source&amp;gt; To sort them in numeric order, numbers in strings can be padded with zeros: &amp;lt;source lang=&quot;lsl2&quot;&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;llListSortStrided&lt;/ins&gt;([&quot;127&quot;, &quot;003&quot;, &quot;025&quot;], 1&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;, 0&lt;/ins&gt;, TRUE) // returns [&quot;003&quot;, &quot;025&quot;, &quot;127&quot;]&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** This order differs from the order of items in a prim&amp;#039;s inventory, which is &amp;quot;natural order&amp;quot; (e.g &amp;quot;New Script 2&amp;quot; is sorted before &amp;quot;New Script 11&amp;quot;).&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;** This order differs from the order of items in a prim&amp;#039;s inventory, which is &amp;quot;natural order&amp;quot; (e.g &amp;quot;New Script 2&amp;quot; is sorted before &amp;quot;New Script 11&amp;quot;).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|constants&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|constants&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l41&quot;&gt;Line 41:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 41:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     {&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         llOwnerSay(&amp;quot;Unsorted: &amp;quot; + llDumpList2String(score_board, &amp;quot;,&amp;quot;));&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         llOwnerSay(&amp;quot;Unsorted: &amp;quot; + llDumpList2String(score_board, &amp;quot;,&amp;quot;));&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         score_board = &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;llListSort&lt;/del&gt;(scoreboard, 3, 0, TRUE);&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         score_board = &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;llListSortStrided&lt;/ins&gt;(scoreboard, 3, 0, TRUE);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         llOwnerSay(&amp;quot;Sort by first names: &amp;quot; + llDumpList2String(numbers, &amp;quot;,&amp;quot;));&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         llOwnerSay(&amp;quot;Sort by first names: &amp;quot; + llDumpList2String(numbers, &amp;quot;,&amp;quot;));&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         // Object: Sort by first names: Awesome,Resident,200,Happy2,Survive,1,Star,Marxman,999&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         // Object: Sort by first names: Awesome,Resident,200,Happy2,Survive,1,Star,Marxman,999&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         score_board = &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;llListSort&lt;/del&gt;(scoreboard, 3, 1, TRUE);&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         score_board = &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;llListSortStrided&lt;/ins&gt;(scoreboard, 3, 1, TRUE);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         llOwnerSay(&amp;quot;Sort by last names: &amp;quot; + llDumpList2String(numbers, &amp;quot;,&amp;quot;));&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         llOwnerSay(&amp;quot;Sort by last names: &amp;quot; + llDumpList2String(numbers, &amp;quot;,&amp;quot;));&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         // Object: Sort by first names: Star,Marxman,999,Awesome,Resident,200,Happy2,Survive,1&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         // Object: Sort by first names: Star,Marxman,999,Awesome,Resident,200,Happy2,Survive,1&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         score_board = &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;llListSort&lt;/del&gt;(scoreboard, 3, 2, TRUE);&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         score_board = &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;llListSortStrided&lt;/ins&gt;(scoreboard, 3, 2, TRUE);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         llOwnerSay(&amp;quot;Sort by last names: &amp;quot; + llDumpList2String(numbers, &amp;quot;,&amp;quot;));&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         llOwnerSay(&amp;quot;Sort by last names: &amp;quot; + llDumpList2String(numbers, &amp;quot;,&amp;quot;));&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         // Object: Sort by first names: ,Happy2,Survive,1,Awesome,Resident,200,Star,Marxman,999&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;         // Object: Sort by first names: ,Happy2,Survive,1,Awesome,Resident,200,Star,Marxman,999&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Aura Linden</name></author>
	</entry>
	<entry>
		<id>https://wiki.secondlife.com/w/index.php?title=LlListSortStrided&amp;diff=1213853&amp;oldid=prev</id>
		<title>Aura Linden: Created page with &quot;{{LSL_Function |inject-2={{Issues/SVC-2988}}{{Issues/SVC-5146}}{{LSL_Function/stride|stride}} |func_id=184|func_sleep=0.0|func_energy=10.0 |func=llListSortStrided|return_type=...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.secondlife.com/w/index.php?title=LlListSortStrided&amp;diff=1213853&amp;oldid=prev"/>
		<updated>2023-04-05T23:51:28Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{LSL_Function |inject-2={{Issues/SVC-2988}}{{Issues/SVC-5146}}{{LSL_Function/stride|stride}} |func_id=184|func_sleep=0.0|func_energy=10.0 |func=llListSortStrided|return_type=...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{LSL_Function&lt;br /&gt;
|inject-2={{Issues/SVC-2988}}{{Issues/SVC-5146}}{{LSL_Function/stride|stride}}&lt;br /&gt;
|func_id=184|func_sleep=0.0|func_energy=10.0&lt;br /&gt;
|func=llListSortStrided|return_type=list&lt;br /&gt;
|func_complexity=O(N&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;)&lt;br /&gt;
|p1_type=list|p1_name=src|p1_desc=List to be sorted.&lt;br /&gt;
|p2_type=integer|p2_name=stride&lt;br /&gt;
|p3_type=integer|p3_name=stride_index|p3_desc=The index within the stride to sort by.  stride_index is 0-indexed.  The first element is 0, second 1, etc. An index of 0 is functionally identical to using llListSort&lt;br /&gt;
|p4_type=integer|p4_name=ascending|p3_desc=if [[TRUE]] then the sort order is ascending, otherwise the order is descending.&lt;br /&gt;
|func_footnote&lt;br /&gt;
|func_desc=llListSortStrided is llListSort with the added parameter of stride_index, adding the flexibility to sort by any item in the stride.&lt;br /&gt;
|return_text=that is {{LSLP|src}} sorted by the {{LSLP|stride_index}} item in every {{LSLP|stride}}.&lt;br /&gt;
|spec=The sort order is affected by type. For strings and keys, it is case sensitive and sorts by Unicode character code.&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;llListSortStrided([&amp;quot;a&amp;quot;, &amp;quot;á&amp;quot;, &amp;quot;B&amp;quot;, &amp;quot;C&amp;quot;, &amp;quot;d&amp;quot;, &amp;quot;e&amp;quot;], 1, 0 TRUE) // returns [&amp;quot;B&amp;quot;, &amp;quot;C&amp;quot;, &amp;quot;a&amp;quot;, &amp;quot;d&amp;quot;, &amp;quot;e&amp;quot;, &amp;quot;á&amp;quot;]&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For ascending sort, each type is sorted individually and then feathered to have the same order of types.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;llListSortStrided([1, &amp;quot;C&amp;quot;, 3, &amp;quot;A&amp;quot;, 2, &amp;quot;B&amp;quot;], 1, 0, TRUE) // returns [1, &amp;quot;A&amp;quot;, 2, &amp;quot;B&amp;quot;, 3, &amp;quot;C&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
llListSortStrided([1, 3, 2, &amp;quot;C&amp;quot;, &amp;quot;A&amp;quot;, &amp;quot;B&amp;quot;], 1, 0, TRUE) // returns [1, 2, 3, &amp;quot;A&amp;quot;, &amp;quot;B&amp;quot;, &amp;quot;C&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
llListSortStrided([1, &amp;quot;C&amp;quot;, 3, &amp;quot;A&amp;quot;, 2, &amp;quot;B&amp;quot;], 2, 0, TRUE) // returns [1, &amp;quot;C&amp;quot;, 2, &amp;quot;B&amp;quot;, 3, &amp;quot;A&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
llListSortStrided([1, &amp;quot;C&amp;quot;, 3, &amp;quot;A&amp;quot;, 2, &amp;quot;B&amp;quot;], 2, 1, TRUE) // returns [3, &amp;quot;A&amp;quot;, 2, &amp;quot;B&amp;quot;, 1, &amp;quot;C&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|caveats=*It uses the same unoptimized selection sort algorithm as llListSort, which is an algorithm with a Big O of N². A [[JIRA]] issue exists to improve this function, {{Jira|SVC-2988}}.&lt;br /&gt;
* Originally the wiki stated that non-zero values for the &amp;quot;ascending&amp;quot; parameter would produce an ascending sort.  That was incorrect.  For this function, the value must be exactly 1 (or TRUE) for an ascending sort.&lt;br /&gt;
* [[Vector]]s are sorted by magnitude. {{Jira|SVC-5643}}&lt;br /&gt;
* [[Rotation]]s are not sorted in any meaningful order. If a list containing only rotations is sorted in ascending order, it will be returned unchanged.&lt;br /&gt;
* For descending sort, if there are mixed types, the final order is deterministic (the same input will always produce the same output) but it can be completely useless. &amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;llListSort([2, &amp;quot;B&amp;quot;, &amp;quot;C&amp;quot;, 3, 1, &amp;quot;A&amp;quot;], 1, FALSE) // returns [&amp;quot;A&amp;quot;, 3, 1, &amp;quot;C&amp;quot;, &amp;quot;B&amp;quot;, 2]&amp;lt;/source&amp;gt; If there are no mixed types, however, the descending sort works just fine.&lt;br /&gt;
* When the stride is greater than 1, if the list length is not a multiple of the stride, the list will be returned unchanged.&lt;br /&gt;
* When strings contain numbers, the numbers are still sorted left-to-right like any other character, which may not necessarily match numeric order: &amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;llListSort([&amp;quot;127&amp;quot;, &amp;quot;3&amp;quot;, &amp;quot;25&amp;quot;], 1, TRUE) // returns [&amp;quot;127&amp;quot;, &amp;quot;25&amp;quot;, &amp;quot;3&amp;quot;] because the 1 in 127 is before the 2 in 25 which is before the 3&amp;lt;/source&amp;gt; To sort them in numeric order, numbers in strings can be padded with zeros: &amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;llListSort([&amp;quot;127&amp;quot;, &amp;quot;003&amp;quot;, &amp;quot;025&amp;quot;], 1, TRUE) // returns [&amp;quot;003&amp;quot;, &amp;quot;025&amp;quot;, &amp;quot;127&amp;quot;]&amp;lt;/source&amp;gt;&lt;br /&gt;
** This order differs from the order of items in a prim&amp;#039;s inventory, which is &amp;quot;natural order&amp;quot; (e.g &amp;quot;New Script 2&amp;quot; is sorted before &amp;quot;New Script 11&amp;quot;).&lt;br /&gt;
|constants&lt;br /&gt;
|examples=&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;&lt;br /&gt;
list score_board = [&amp;quot;Awesome&amp;quot;, &amp;quot;Resident&amp;quot;, 200, &amp;quot;Star&amp;quot;, &amp;quot;Marxman&amp;quot;, 999, &amp;quot;Happy2&amp;quot;, &amp;quot;Survive&amp;quot;, 1];&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        llOwnerSay(&amp;quot;Unsorted: &amp;quot; + llDumpList2String(score_board, &amp;quot;,&amp;quot;));&lt;br /&gt;
        score_board = llListSort(scoreboard, 3, 0, TRUE);&lt;br /&gt;
        llOwnerSay(&amp;quot;Sort by first names: &amp;quot; + llDumpList2String(numbers, &amp;quot;,&amp;quot;));&lt;br /&gt;
        // Object: Sort by first names: Awesome,Resident,200,Happy2,Survive,1,Star,Marxman,999&lt;br /&gt;
&lt;br /&gt;
        score_board = llListSort(scoreboard, 3, 1, TRUE);&lt;br /&gt;
        llOwnerSay(&amp;quot;Sort by last names: &amp;quot; + llDumpList2String(numbers, &amp;quot;,&amp;quot;));&lt;br /&gt;
        // Object: Sort by first names: Star,Marxman,999,Awesome,Resident,200,Happy2,Survive,1&lt;br /&gt;
&lt;br /&gt;
        score_board = llListSort(scoreboard, 3, 2, TRUE);&lt;br /&gt;
        llOwnerSay(&amp;quot;Sort by last names: &amp;quot; + llDumpList2String(numbers, &amp;quot;,&amp;quot;));&lt;br /&gt;
        // Object: Sort by first names: ,Happy2,Survive,1,Awesome,Resident,200,Star,Marxman,999&lt;br /&gt;
&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
llListSort and llListSortStrided really only works on items of the same type. It will work on lists that hold diverse data types -- to be clear, it won&amp;#039;t blow up your script -- but the results returned are usually meaningless.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;list mylist = [&amp;quot;brown&amp;quot;, &amp;lt;0.000000, 0.000000, 0.000000&amp;gt;, &amp;quot;house&amp;quot;, 17.005, 100, &amp;quot;cat&amp;quot;, &amp;lt;3.000000, 3.000000, 3.000000&amp;gt;, 39];&lt;br /&gt;
list tmplist = llListSortStrided(mylist, 1, 0, TRUE);&lt;br /&gt;
llSay(0, llList2CSV(tmplist));&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This returns in chat:&lt;br /&gt;
&lt;br /&gt;
 brown, &amp;lt;0.000000, 0.000000, 0.000000&amp;gt;, cat, 17.004999, 39, house, &amp;lt;3.000000, 3.000000, 3.000000&amp;gt;, 100&lt;br /&gt;
&lt;br /&gt;
The same ordered in descending order returns even more meaningless results:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;list mylist = [&amp;quot;brown&amp;quot;, &amp;lt;0.000000, 0.000000, 0.000000&amp;gt;, &amp;quot;house&amp;quot;, 17.005, 100, &amp;quot;cat&amp;quot;, &amp;lt;3.000000, 3.000000, 3.000000&amp;gt;, 39];&lt;br /&gt;
list tmplist = llListSortStrided(mylist, 1, 0, FALSE);&lt;br /&gt;
llSay(0, llList2CSV(tmplist));&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
returns in chat:&lt;br /&gt;
&lt;br /&gt;
 39, &amp;lt;3.000000, 3.000000, 3.000000&amp;gt;, cat, 100, 17.004999, house, &amp;lt;0.000000, 0.000000, 0.000000&amp;gt;, brown&lt;br /&gt;
&lt;br /&gt;
===Utilizing the Results===&lt;br /&gt;
&lt;br /&gt;
It&amp;#039;s important to note that the source list that you are sorting will remain unchanged. Instead, a new, sorted list will be produced. So, it&amp;#039;s important that you capture this with a variable (unless you are acting directly on the results.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;llListSortStrided(myList, 1, 0, TRUE); // You&amp;#039;ve wasted cpu time; you didn&amp;#039;t capture the results&lt;br /&gt;
&lt;br /&gt;
list newlist = llListSortStrided(myList, 1, 0, TRUE);// Okay. You&amp;#039;ve captured the results.&lt;br /&gt;
&lt;br /&gt;
llSay(0,llList2CSV(llListSortStrided(myList, 1, 0, TRUE))); // No need to capture, using the results right away.&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==={{LSLPT|Stride}} parameter===&lt;br /&gt;
&lt;br /&gt;
Most times, you will want to set &amp;quot;integer stride&amp;quot; to 1 (0 also works) to tell it to sort each item in the list on its own basis. (If you are working with a strided list, though, see the special section below on sorting strides.)&lt;br /&gt;
&lt;br /&gt;
===Sort Order===&lt;br /&gt;
&lt;br /&gt;
Setting the parameter &amp;quot;integer ascending&amp;quot; to [[TRUE]] returns a sorted list that is in ascending order. &amp;lt;br/&amp;gt;&lt;br /&gt;
For example: [&amp;quot;Apples&amp;quot;, &amp;quot;Bananas&amp;quot;, &amp;quot;Oranges&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
Setting the parameter &amp;quot;integer ascending&amp;quot; to [[FALSE]] returns a sorted list that is in descending order. &amp;lt;br/&amp;gt;&lt;br /&gt;
For example: [&amp;quot;Oranges&amp;quot;, &amp;quot;Bananas&amp;quot;, &amp;quot;Apples&amp;quot;]&lt;br /&gt;
&lt;br /&gt;
===Sorting Strided Lists===&lt;br /&gt;
&lt;br /&gt;
If you have a [[List#Strided_lists|strided list]], in which you are keeping related pieces of data together in chunks, letting each list element sort on its own basis would be disastrous.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;list demographics = [&amp;quot;John Adams&amp;quot;, &amp;quot;male&amp;quot;, &amp;quot;2007-06-22&amp;quot;, &amp;quot;Shirley Bassey&amp;quot;, &amp;quot;female&amp;quot;, &amp;quot;2005-11-02&amp;quot;, &amp;quot;Matt Damon&amp;quot;, &amp;quot;male&amp;quot;, &amp;quot;2008-05-19&amp;quot;];&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Bad Example====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;list tmplist_1 = llListSortStrided(demographics, 1, 0, TRUE);&lt;br /&gt;
//tmplist_1 == [&amp;quot;2005-11-02&amp;quot;, &amp;quot;2007-06-22&amp;quot;, &amp;quot;2008-05-19&amp;quot;, &amp;quot;John Adams&amp;quot;, &amp;quot;Matt Damon&amp;quot;, &amp;quot;Shirley Bassey&amp;quot;, &amp;quot;female&amp;quot;, &amp;quot;male&amp;quot;, &amp;quot;male&amp;quot;]&lt;br /&gt;
//The strides have been destroyed, the sorted data is now useless&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Good Example====&lt;br /&gt;
&lt;br /&gt;
Instead, because you have the data grouped (aka &amp;quot;strided&amp;quot;) in sets of 3, you need to do this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lsl2&amp;quot;&amp;gt;list tmplist_2 = llListSortStrided(demographics, 3, 0, TRUE);&lt;br /&gt;
//templist_2 = [&amp;quot;John Adams&amp;quot;, &amp;quot;male&amp;quot;, &amp;quot;2007-06-22&amp;quot;, &amp;quot;Matt Damon&amp;quot;, &amp;quot;male&amp;quot;, &amp;quot;2008-05-19&amp;quot;, &amp;quot;Shirley Bassey&amp;quot;, &amp;quot;female&amp;quot;, &amp;quot;2005-11-02&amp;quot;]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|permission&lt;br /&gt;
|negative_index&lt;br /&gt;
|sort=ListSort&lt;br /&gt;
|cat1=List&lt;br /&gt;
|cat2&lt;br /&gt;
|cat3&lt;br /&gt;
|cat4&lt;br /&gt;
|location&lt;br /&gt;
|issues=&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Aura Linden</name></author>
	</entry>
</feed>