<?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=18407&amp;type=atom" />
	<updated>2025-03-22T20:09:38Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=18407</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Перебор с конца]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162121#p162121" />
			<content type="html"><![CDATA[<p><strong>1srafel</strong><br />Вроде ничего сложного, можно даже через строку обработать:</p><div class="codebox"><pre><code>Text := &quot;&lt;1&gt;&lt;2&gt;&lt;3&gt;&lt;4&gt;&quot;

Rep := RegExReplace(Text, &quot;&lt;(\d+)&gt;&quot;, &quot;$1|&quot;)	; Извлекаем числа.
Sort, Rep, R N D|			; Сортировка реверсная, числовая, &#039;|&#039; как делитель.
Rep := RTrim(Rep, &quot;|&quot;)		; Убрать последний символ &#039;|&#039;.
MsgBox, % Rep				; Отображаем строку.

;Превращаем строку в список:
Arr := StrSplit(Rep, &quot;|&quot;)
For k,v in Arr
 MsgBox, % &quot;Индекс:`t`t&quot; k &quot;`nСодержимое:`t&quot; v
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[__Михаил__]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40928</uri>
			</author>
			<updated>2025-03-22T20:09:38Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162121#p162121</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Перебор с конца]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162120#p162120" />
			<content type="html"><![CDATA[<p>К сожалению, не разобрался с массивами. Получилось так:<br /></p><div class="codebox"><pre><code>n := &quot;&lt;1&gt;&lt;2&gt;&lt;3&gt;&lt;4&gt;&quot;

arr := StrSplit(n, &quot;&lt;&quot;, &quot;&gt;&quot;)
max := arr.MaxIndex()
Loop % max
   MsgBox, % RegExReplace( arr[ max - A_Index + 1 ], &quot;&lt;(\d+)&gt;&quot;, &quot;$1&quot; )</code></pre></div>]]></content>
			<author>
				<name><![CDATA[1srafel]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=43566</uri>
			</author>
			<updated>2025-03-22T17:40:20Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162120#p162120</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Перебор с конца]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162119#p162119" />
			<content type="html"><![CDATA[<p>Как вы в первом посте перебираете строку в обычном порядке, так и создавайте массив.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2025-03-22T16:54:39Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162119#p162119</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Перебор с конца]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162118#p162118" />
			<content type="html"><![CDATA[<p>Нашелся такой пример, но затрюдняюсь модифицировать для случая, когда вхождения находятся на одной строке:<br /></p><div class="codebox"><pre><code>cmt_pages=
(
&quot;id&quot;: &quot;1&quot;,
&quot;id&quot;: &quot;2&quot;,
&quot;id&quot;: &quot;3&quot;,
&quot;id&quot;: &quot;4&quot;,
&quot;id&quot;: &quot;5&quot;,
&quot;id&quot;: &quot;6&quot;,
)
arr := StrSplit(cmt_pages, &quot;`n&quot;, &quot;`r&quot;)
max := arr.MaxIndex()
Loop % max
   MsgBox, % RegExReplace( arr[ max - A_Index + 1 ], &quot;&quot;&quot;id&quot;&quot;:\s&quot;&quot;([^&quot;&quot;]+).*&quot;, &quot;$1&quot; )</code></pre></div><p>То есть, так:<br /></p><div class="codebox"><pre><code>cmt_pages=
(
&lt;1&gt;&lt;2&gt;&lt;3&gt;&lt;4&gt;
)
arr := StrSplit(cmt_pages, &quot;`n&quot;, &quot;`r&quot;)
max := arr.MaxIndex()
Loop % max
   MsgBox, % RegExReplace( arr[ max - A_Index + 1 ], &quot;&lt;(\d+)&gt;&quot;, &quot;$1&quot; )</code></pre></div>]]></content>
			<author>
				<name><![CDATA[1srafel]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=43566</uri>
			</author>
			<updated>2025-03-22T16:09:51Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162118#p162118</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Перебор с конца]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162117#p162117" />
			<content type="html"><![CDATA[<p>Может сначала записать всё в список, затем будет проще с обработкой каждого элемента.</p>]]></content>
			<author>
				<name><![CDATA[__Михаил__]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40928</uri>
			</author>
			<updated>2025-03-22T13:50:50Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162117#p162117</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Перебор с конца]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=162116#p162116" />
			<content type="html"><![CDATA[<p>Как перебирать пример с конца содержимого переменной - сначала выводя &quot;4&quot;, потом &quot;3&quot; и т.д.?<br /></p><div class="codebox"><pre><code>n := &quot;&lt;1&gt;&lt;2&gt;&lt;3&gt;&lt;4&gt;&quot;

match := &quot;&quot;, match1 := &quot;&quot;, Pos := 0
While Pos := RegExMatch(n, &quot;&lt;(\d+)&gt;&quot;, match, Pos + 1)
   MsgBox, %match1%</code></pre></div>]]></content>
			<author>
				<name><![CDATA[1srafel]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=43566</uri>
			</author>
			<updated>2025-03-22T13:27:05Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=162116#p162116</id>
		</entry>
</feed>
