<?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=14037&amp;type=atom" />
	<updated>2018-08-14T20:04:20Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=14037</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Добавление переменных в строки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=127945#p127945" />
			<content type="html"><![CDATA[<p>Сохраняйте всё в новую переменную.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2018-08-14T20:04:20Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=127945#p127945</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Добавление переменных в строки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=127943#p127943" />
			<content type="html"><![CDATA[<p>Спасибо, отредактировал. А как сделать, чтобы изменения отразились во входном тексте?</p>]]></content>
			<author>
				<name><![CDATA[DD]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25263</uri>
			</author>
			<updated>2018-08-14T19:42:00Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=127943#p127943</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Добавление переменных в строки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=127942#p127942" />
			<content type="html"><![CDATA[<p>При нахождении нужной строки увеличивайте счётчик n на 1 и в regexreplace замену делайте на grp%n%.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2018-08-14T19:07:12Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=127942#p127942</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Добавление переменных в строки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=127941#p127941" />
			<content type="html"><![CDATA[<p>Вот всё, что получилось. Не понятно, как подставлять следующие переменные с учётом строк с &quot;ids&quot;:<br /></p><div class="codebox"><pre><code>grp1 := -123
grp2 := -456
grp3 := -789

Wall_Info_List =
(
{
&quot;response&quot;: [[{
&quot;ids&quot;: [380061, 419984, 419674, 419602],
&quot;comments&quot;: [0, 93, 87, 55]
}], [{
&quot;ids&quot;: [54514, 55045, 55026, 54956],
&quot;comments&quot;: [19, 1, 3, 20]
}], [{
&quot;ids&quot;: [37816, 49610, 49605, 49593],
&quot;comments&quot;: [3, 4, 1, 6]
}]]
}
)
n := 0
Loop, parse, Wall_Info_List, `n
{
   str := A_LoopField
   ifInString, A_Loopfield, &quot;ids&quot;
   {
       n+=1
       str := RegExReplace(str, &quot;(\d+)&quot;, grp%n% &quot;_$1&quot;)
   }
   txtAll .= str &quot;`n&quot;
}
Msgbox, %txtAll%</code></pre></div>]]></content>
			<author>
				<name><![CDATA[DD]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25263</uri>
			</author>
			<updated>2018-08-14T18:46:32Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=127941#p127941</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Добавление переменных в строки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=127919#p127919" />
			<content type="html"><![CDATA[<p>Так обрабатывайте в виде обычного текста.<br />Циклом либо регуляркой проходитесь по строкам, вытаскиваете нужные вам значения и заменяете их на новые.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2018-08-14T05:35:22Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=127919#p127919</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Добавление переменных в строки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=127908#p127908" />
			<content type="html"><![CDATA[<p>Да, и так можно, тоже подойдёт. Просто предположил, что для JSON код будет объёмней, в отличие от обработки в виде обычного текста.</p>]]></content>
			<author>
				<name><![CDATA[DD]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25263</uri>
			</author>
			<updated>2018-08-13T23:23:36Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=127908#p127908</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Добавление переменных в строки]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=127906#p127906" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>grp1 := -123
grp2 := -456
grp3 := -789

Wall_Info_List =
(
{
&quot;response&quot;: [[{
&quot;ids&quot;: [380061, 419984, 419674, 419602],
&quot;comments&quot;: [0, 93, 87, 55]
}], [{
&quot;ids&quot;: [54514, 55045, 55026, 54956],
&quot;comments&quot;: [19, 1, 3, 20]
}], [{
&quot;ids&quot;: [37816, 49610, 49605, 49593],
&quot;comments&quot;: [3, 4, 1, 6]
}]]
}
)</code></pre></div><p>Привет. Как добавить в приведенном примере кода: к первым &quot;ids&quot; — переменную &quot;grp1&quot;, ко вторым — переменную &quot;grp2&quot; — и так далее, в зависимости от количества строк с &quot;ids&quot;, с таким результатом? —</p><div class="codebox"><pre><code>grp1 := -123
grp2 := -456
grp3 := -789

Wall_Info_List =
(
{
&quot;response&quot;: [[{
&quot;ids&quot;: [-123_380061, -123_419984, -123_419674, -123_419602],
&quot;comments&quot;: [0, 93, 87, 55]
}], [{
&quot;ids&quot;: [-456_54514, -456_55045, -456_55026, -456_54956],
&quot;comments&quot;: [19, 1, 3, 20]
}], [{
&quot;ids&quot;: [-789_37816, -789_49610, -789_49605, -789_49593],
&quot;comments&quot;: [3, 4, 1, 6]
}]]
}
)</code></pre></div><p>Это надо для мониторинга ВКонтакта — появилась возможность отслеживать за один вызов — обновление для ста последних постов, в — до 25-ти сообществах.</p>]]></content>
			<author>
				<name><![CDATA[DD]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25263</uri>
			</author>
			<updated>2018-08-13T21:26:34Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=127906#p127906</id>
		</entry>
</feed>
