<?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=15967&amp;type=atom" />
	<updated>2021-01-05T09:09:07Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=15967</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обнуление переменной в цикле]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=144528#p144528" />
			<content type="html"><![CDATA[<p>Вот вам ещё пример:<br /></p><div class="codebox"><pre><code>col := 3
While 1, p1 := (Ceil(A_Index / col) - 1), p2 := (Mod(A_Index - 1, col))
	MsgBox, , % A_Index, % p1 &quot;_&quot; p2, 0.3</code></pre></div><div class="quotebox"><cite>DD пишет:</cite><blockquote><p>но поскольку это значение непостоянное и оно неизвестно</p></blockquote></div><p>То вам это обнуление ничего не даёт.<br /></p><div class="quotebox"><cite>DD пишет:</cite><blockquote><p>тогда было бы самое то.</p></blockquote></div><p>У вас хорошо получается не слышать вопросы а задавать свои. Всё это уже давно сделано в той теме. Вместо того чтобы ответить на элементарный вопрос - чем не устраивает то что есть и работает, вы начинаете скакать по темам изобретая свой велосипед, неудосуживая себя устройством имеющегося.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2021-01-05T09:09:07Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=144528#p144528</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обнуление переменной в цикле]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=144527#p144527" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>DD пишет:</cite><blockquote><p>А как правильно записать конструкцию, чтобы msgbox показывал? —</p><p>&nbsp; &nbsp; 0_0, 0_1, 0_2<br />&nbsp; &nbsp; 1_0, 1_1, 1_2<br />&nbsp; &nbsp; 2_0, 2_1, 2_2<br />&nbsp; &nbsp; ...</p></blockquote></div><p>Например так:<br /></p><div class="codebox"><pre><code>num1 := num2 := 0
Loop
{
   if (num2 = 3)
   {
      num1++
      num2 := 0
   }
   MsgBox, %num1%_%num2%
   num2++
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2021-01-05T04:47:22Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=144527#p144527</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обнуление переменной в цикле]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=144526#p144526" />
			<content type="html"><![CDATA[<p>В таком виде это записать не получится?<br /></p><div class="codebox"><pre><code>num1 := 0
Loop
{
   num2++
   num2 := A_Index - 1
   If num2 = 5
   {
      num1 := num1+1
      num2 := 0
      ;break
   }
   MsgBox, %num1%_%num2%
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[DD]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25263</uri>
			</author>
			<updated>2021-01-04T22:31:42Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=144526#p144526</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обнуление переменной в цикле]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=144525#p144525" />
			<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>2021-01-04T22:12:25Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=144525#p144525</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обнуление переменной в цикле]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=144524#p144524" />
			<content type="html"><![CDATA[<p><em></em></p>]]></content>
			<author>
				<name><![CDATA[DD]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25263</uri>
			</author>
			<updated>2021-01-04T22:10:41Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=144524#p144524</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обнуление переменной в цикле]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=144523#p144523" />
			<content type="html"><![CDATA[<p>Если заменить 28 на 5 в предложенном вами формате цикла — к задаче подходит, но поскольку это значение непостоянное и оно неизвестно <strong>до</strong> вхождения в цикл (как в моем примере) — тогда и на практике использовать затруднительно. Ну а страницы и фрагменты я упомянул для вас — так как вы привели число 28, а значит в общих чертах знакомы с конечной задачей, которую всем присутствующим знать нет особой необходимости).</p>]]></content>
			<author>
				<name><![CDATA[DD]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25263</uri>
			</author>
			<updated>2021-01-04T22:06:38Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=144523#p144523</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обнуление переменной в цикле]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=144522#p144522" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>DD пишет:</cite><blockquote><p>Как обнулить переменную A_Index после 5-го цикла?</p></blockquote></div><div class="quotebox"><cite>DD пишет:</cite><blockquote><p>последнее число (28) не подходит</p></blockquote></div><p>У <strong>вас</strong> написано после 5-го. Надо заменить 28 на 5, и великолепно подходит к поставленной <strong>вами</strong> задаче.<br /></p><div class="quotebox"><cite>DD пишет:</cite><blockquote><p>значение может быть разным от страницы к странице. Хотя если вычислить, на сколько фрагментов делится изображение — в данном случае: 5853x7280 — тогда было бы самое то.</p></blockquote></div><p>Зато у вас хорошо получается обнулить смысл своей же темы.<br />Обнуление переменной в цикле - и внезапно понеслись &quot;страницы, фрагменты, изображение, ссылка на какой то json&quot; безо всяких, для всех тут присутствующих, пояснений.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2021-01-04T21:48:21Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=144522#p144522</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обнуление переменной в цикле]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=144521#p144521" />
			<content type="html"><![CDATA[<p>Там на практике указывать последнее число (28) не подходит — значение может быть разным от страницы к странице. Хотя если вычислить, на сколько фрагментов делится изображение — в данном случае: <a href="http://www.bl.uk/manuscripts/Proxy.ashx?view=yates_thompson_ms_36_f001r.xml">5853x7280</a> — тогда было бы самое то.</p>]]></content>
			<author>
				<name><![CDATA[DD]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25263</uri>
			</author>
			<updated>2021-01-04T21:35:27Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=144521#p144521</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обнуление переменной в цикле]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=144520#p144520" />
			<content type="html"><![CDATA[<p>Вот вам самый наглядный пример, не в плане кода конечно.<br /></p><div class="codebox"><pre><code>col := 28, row := 20
Loop % col * row 
	ToolTip % str .= (Ceil(A_Index / col) - 1) &quot;_&quot; (1 + Mod(A_Index - 1, col)) &quot;`n&quot;
	, % (Ceil(A_Index / col) * 44, !Mod(A_Index, col) &amp;&amp; str := &quot;&quot;), 44, % Ceil(A_Index / col) </code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2021-01-04T21:25:06Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=144520#p144520</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обнуление переменной в цикле]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=144519#p144519" />
			<content type="html"><![CDATA[<p>А как правильно записать конструкцию, чтобы msgbox показывал? — <br /></p><div class="quotebox"><blockquote><p>0_0, 0_1, 0_2<br />1_0, 1_1, 1_2<br />2_0, 2_1, 2_2<br />...</p></blockquote></div><div class="codebox"><pre><code>Loop
{
   num1 := 0
   num2 := A_Index - 1
   num2++
   If num2 = 3
   {
      num1 := 0
      num2 := num2+1
   }
   MsgBox, %num1%_%num2%
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[DD]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25263</uri>
			</author>
			<updated>2021-01-04T20:53:38Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=144519#p144519</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обнуление переменной в цикле]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=144518#p144518" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>Loop
{
num2++
If num2 = 5
num2 := 0
MsgBox, %A_Index%`n%num2%
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2021-01-04T20:05:35Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=144518#p144518</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обнуление переменной в цикле]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=144517#p144517" />
			<content type="html"><![CDATA[<p>А <em>num2</em> обнулить, чтобы после этого происходило наращивание?</p>]]></content>
			<author>
				<name><![CDATA[DD]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25263</uri>
			</author>
			<updated>2021-01-04T19:57:36Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=144517#p144517</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Обнуление переменной в цикле]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=144516#p144516" />
			<content type="html"><![CDATA[<p>A_Index - встроенная переменная, её не обнулить в цикле.</p>]]></content>
			<author>
				<name><![CDATA[__Михаил__]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40928</uri>
			</author>
			<updated>2021-01-04T19:40:20Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=144516#p144516</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Обнуление переменной в цикле]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=144515#p144515" />
			<content type="html"><![CDATA[<p>Как обнулить переменную A_Index после 5-го цикла?<br /></p><div class="codebox"><pre><code>num1 := 0

while (num2 := 0 + (A_Index - 1)*1) &lt;= 9999999
{
   msgbox % num2
   If (A_Index = 5)
   {
      num2 :=  0
      num1 := num1 + 1
      msgbox % num2
      ;break
   }
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[DD]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25263</uri>
			</author>
			<updated>2021-01-04T19:36:16Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=144515#p144515</id>
		</entry>
</feed>
