<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Сортировка по элементу вложенного массиву]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=15832&amp;type=atom" />
	<updated>2020-11-16T06:05:49Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=15832</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Сортировка по элементу вложенного массиву]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=143494#p143494" />
			<content type="html"><![CDATA[<p>Новый массив, в котором элементы добавлены в нужном порядке.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2020-11-16T06:05:49Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=143494#p143494</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Сортировка по элементу вложенного массиву]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=143492#p143492" />
			<content type="html"><![CDATA[<p>А что означает эта строчка ? <br /></p><div class="codebox"><pre><code>
newarray[-v[2]] := [k, v[1], v[2]]
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Botsy]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=41069</uri>
			</author>
			<updated>2020-11-15T22:49:11Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=143492#p143492</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Сортировка по элементу вложенного массиву]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=143491#p143491" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>myarray := []
myarray[&quot;test&quot;] := [&quot;34&quot;, 10356]
myarray[&quot;test54&quot;] := [&quot;35&quot;, 10146]
myarray[&quot;test34&quot;] := [&quot;32&quot;, 10642]
myarray[&quot;test223&quot;] := [&quot;35&quot;, 10455]

newarray := []
for k, v in myarray
	newarray[-v[2]] := [k, v[1], v[2]]
for k, v in newarray
	MsgBox % v[1] &quot;`n&quot; v[2] &quot;`n&quot; v[3]</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2020-11-15T22:34:34Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=143491#p143491</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Сортировка по элементу вложенного массиву]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=143489#p143489" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Если у вас второй элемент в кавычках, надо думать, что он должен быть интерпретирован, как строка? Соответственно, если одно из значений, например, &quot;2&quot;, то оно должно быть впереди всех в вашем примере?</p></blockquote></div><p>Нет, там числовое значение. Поправил в вопросе.</p>]]></content>
			<author>
				<name><![CDATA[Turambar]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33097</uri>
			</author>
			<updated>2020-11-15T21:31:18Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=143489#p143489</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Сортировка по элементу вложенного массиву]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=143488#p143488" />
			<content type="html"><![CDATA[<p>Если у вас второй элемент в кавычках, надо думать, что он должен быть интерпретирован, как строка? Соответственно, если одно из значений, например, &quot;2&quot;, то оно должно быть впереди всех в вашем примере?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2020-11-15T21:26:18Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=143488#p143488</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Сортировка по элементу вложенного массиву]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=143487#p143487" />
			<content type="html"><![CDATA[<p>Здравствуйте.<br />Имеется массив со вложенностью.</p><div class="codebox"><pre><code>
myarray[&quot;test&quot;] := [&quot;34&quot;, 10356]
myarray[&quot;test54&quot;] := [&quot;35&quot;, 10146]
myarray[&quot;test34&quot;] := [&quot;32&quot;, 10642]
myarray[&quot;test223&quot;] := [&quot;35&quot;, 10455]
</code></pre></div><p>Нужно переформатировать массив так, чтобы элементы располагались по нисходящей в зависимости от значения второго элемента вложенного массива:<br /></p><div class="codebox"><pre><code>
myarray[&quot;test34&quot;] (10642)
myarray[&quot;test223&quot;] (10455)
myarray[&quot;test&quot;] (10356)
myarray[&quot;test54&quot;] (10146)
</code></pre></div><p>Как это проще всего сделать? Заранее благодарен за ответ.</p>]]></content>
			<author>
				<name><![CDATA[Turambar]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33097</uri>
			</author>
			<updated>2020-11-15T20:31:38Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=143487#p143487</id>
		</entry>
</feed>
