<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Счетчик k:=0, k:=%k%+1,]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=6411&amp;type=atom" />
	<updated>2011-11-06T12:28:27Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=6411</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Счетчик k:=0, k:=%k%+1,]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=53295#p53295" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>F1::
   Msgbox,,, % k:=0, 1
Begin:
   If k=6
      Goto, Exit
   Sleep, 150
   Msgbox,,, % k+=1, 1
   Goto, Begin
Exit:
   Msgbox,,, Done, 1
   Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Grey]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25792</uri>
			</author>
			<updated>2011-11-06T12:28:27Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=53295#p53295</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Счетчик k:=0, k:=%k%+1,]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=53294#p53294" />
			<content type="html"><![CDATA[<p>спасибо за решение.</p>]]></content>
			<author>
				<name><![CDATA[hojo]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27325</uri>
			</author>
			<updated>2011-11-06T12:13:30Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=53294#p53294</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Счетчик k:=0, k:=%k%+1,]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=53293#p53293" />
			<content type="html"><![CDATA[<p>Вариант с таймером:</p><div class="codebox"><pre><code>F1::
   Msgbox,,, % k:=0, 1
   SetTimer, Countdown, 10
   Return

Countdown:
   Counter++
   If k=6
   {
      SetTimer, Countdown, Off
      Goto, Exit
   }
   Else
   {
      Sleep, 150
      k:=Counter
      Msgbox,,, % k, 1
   }
   Return

Exit:
   Counter:=0
   Msgbox,,, Done, 1
   Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Grey]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25792</uri>
			</author>
			<updated>2011-11-06T12:13:26Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=53293#p53293</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Счетчик k:=0, k:=%k%+1,]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=53292#p53292" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>F1::
   Msgbox,,, % k:=0, 1
   Loop
   {
      If k=6
         Goto, Exit
      Else
      {
         Sleep, 150
         k:=k+1
         Msgbox,,, % k, 1
      }
   }
Exit:
   Msgbox,,, Done, 1
   Return</code></pre></div><p>Так как это цикл, можно использовать встроенную переменную:</p><div class="codebox"><pre><code>F1::
   Msgbox,,, % k:=0, 1
   Loop
   {
      If k=6
         Break
      Else
      {
         Sleep, 150
         k:=A_Index
         Msgbox,,, % k, 1
      }
   }
   Msgbox,,, Done, 1
   Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Grey]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25792</uri>
			</author>
			<updated>2011-11-06T12:07:25Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=53292#p53292</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Счетчик k:=0, k:=%k%+1,]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=53291#p53291" />
			<content type="html"><![CDATA[<p>Здраствуйте. Возникла проблема реализации счетчика.</p><div class="codebox"><pre><code>
F5::reload
F1::

k:=0

msgbox,%k%

loop
{
	if k=6
		{
			goto exit
		}
	else
		{
			sleep 150
			k:=%k%+1
			msgbox,%k%
		}
}
exit:
msgbox,Done
}</code></pre></div><p>Первый msgbox,&nbsp; k=0<br />Второй msgbox, k=1 <br />А все последующие пустые. Как правильно организовать увеличение счетчика ?<br />Я может не знаю, но существует какая нибудь inc(k) функция в ахк.</p>]]></content>
			<author>
				<name><![CDATA[hojo]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27325</uri>
			</author>
			<updated>2011-11-06T11:20:53Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=53291#p53291</id>
		</entry>
</feed>
