<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Перебор с конца]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=18407</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=18407&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Перебор с конца».]]></description>
		<lastBuildDate>Sat, 22 Mar 2025 20:09:38 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Перебор с конца]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=162121#p162121</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (__Михаил__)]]></author>
			<pubDate>Sat, 22 Mar 2025 20:09:38 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=162121#p162121</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Перебор с конца]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=162120#p162120</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (1srafel)]]></author>
			<pubDate>Sat, 22 Mar 2025 17:40:20 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=162120#p162120</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Перебор с конца]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=162119#p162119</link>
			<description><![CDATA[<p>Как вы в первом посте перебираете строку в обычном порядке, так и создавайте массив.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Sat, 22 Mar 2025 16:54:39 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=162119#p162119</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Перебор с конца]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=162118#p162118</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (1srafel)]]></author>
			<pubDate>Sat, 22 Mar 2025 16:09:51 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=162118#p162118</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Перебор с конца]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=162117#p162117</link>
			<description><![CDATA[<p>Может сначала записать всё в список, затем будет проще с обработкой каждого элемента.</p>]]></description>
			<author><![CDATA[null@example.com (__Михаил__)]]></author>
			<pubDate>Sat, 22 Mar 2025 13:50:50 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=162117#p162117</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Перебор с конца]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=162116#p162116</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (1srafel)]]></author>
			<pubDate>Sat, 22 Mar 2025 13:27:05 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=162116#p162116</guid>
		</item>
	</channel>
</rss>
