<?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=15146&amp;type=atom" />
	<updated>2020-01-24T15:18:17Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=15146</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Задание ширины счётчика]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=137473#p137473" />
			<content type="html"><![CDATA[<p>Если начинать всегда от 1, то так:<br /></p><div class="codebox"><pre><code>width := 4
step := 2
max := 20

while (value := 1 + (A_Index - 1)*step) &lt;= max
   MsgBox, % Format(&quot;{:0&quot; . width . &quot;u}&quot;, value)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2020-01-24T15:18:17Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=137473#p137473</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Задание ширины счётчика]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=137472#p137472" />
			<content type="html"><![CDATA[<p>Так и есть, «n := 20» — это у меня не шаг, а максимальное число. Всё равно совместить не удается.</p>]]></content>
			<author>
				<name><![CDATA[DD]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25263</uri>
			</author>
			<updated>2020-01-24T13:48:32Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=137472#p137472</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Задание ширины счётчика]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=137470#p137470" />
			<content type="html"><![CDATA[<p>По-моему, вы запутались в определениях. Под шагом обычно понимается число, которое нужно прибавить к текущему значению, чтобы получить следующее. Чтобы добавить нули до определённой ширины числа, делается, как показано выше.<br /></p><div class="codebox"><pre><code>width := 4

Loop
   MsgBox, % Format(&quot;{:0&quot; . width . &quot;u}&quot;, A_Index)</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2020-01-24T10:35:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=137470#p137470</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Задание ширины счётчика]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=137466#p137466" />
			<content type="html"><![CDATA[<p>Приведённый у меня код последовательно выводит &quot;0&quot;, &quot;1&quot;, &quot;2&quot;, &quot;3&quot; и т.д., до 20-ти. А требуется, чтобы для указанной ширины счётчика (например: для 4-х) выводилось &quot;0000&quot;, &quot;0001&quot;, &quot;0002&quot;, &quot;0003&quot; ... &quot;0010&quot;, &quot;0011&quot; и т.д. И чтобы это сохранялось, если шаг (n := 20) будет увеличен 9999-ти.</p>]]></content>
			<author>
				<name><![CDATA[DD]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25263</uri>
			</author>
			<updated>2020-01-23T19:18:29Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=137466#p137466</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Задание ширины счётчика]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=137465#p137465" />
			<content type="html"><![CDATA[<p>Я не понял про что ваш пример.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2020-01-23T19:07:07Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=137465#p137465</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Задание ширины счётчика]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=137464#p137464" />
			<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>2020-01-23T19:04:15Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=137464#p137464</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Задание ширины счётчика]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=137463#p137463" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>
КоличествоЦифр := 10 
nn := 1
loop % КоличествоЦифр  
{
	nn *= 10
	str .= Format(&quot;{:0&quot; КоличествоЦифр &quot;}&quot;, nn - 1) &quot;`n&quot; 
}
MsgBox % str 
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2020-01-23T18:45:19Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=137463#p137463</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Задание ширины счётчика]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=137462#p137462" />
			<content type="html"><![CDATA[<p>Как добавить к коду настройку ширины счётчика, чтобы, когда цифр меньше указанного количества цифр, в начале к ним добавлялись бы нули (для фиксированной ширины)? Например, для ширины в четыре цифры:<br /></p><div class="quotebox"><blockquote><p>0001<br />0002<br />0003<br />...</p></blockquote></div><div class="codebox"><pre><code>
;КоличествоЦифр := 4
n := 20
step := 1
  
loop % 1 + n // step 
{
     nn := (A_index - 1) * step &quot;`n&quot; 
     MsgBox % nn
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[DD]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25263</uri>
			</author>
			<updated>2020-01-23T18:34:29Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=137462#p137462</id>
		</entry>
</feed>
