<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Инициализация переменной с помощью StrPut()]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=7975&amp;type=atom" />
	<updated>2013-01-14T07:55:21Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=7975</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Инициализация переменной с помощью StrPut()]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=68472#p68472" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>creature.ws пишет:</cite><blockquote><p>Я бы перефразировал — почему без использования <strong>varsetcapacity(var2, -1)</strong> содержимое <em>var2</em> таки отображается и отображется именно так <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p></blockquote></div><p>И на этом спасибо <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" />.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2013-01-14T07:55:21Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=68472#p68472</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Инициализация переменной с помощью StrPut()]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=68470#p68470" />
			<content type="html"><![CDATA[<p>Если в коде сообщения #1 закомментировать первый Msgbox, то var2 будет представлена в виде «ё», предположу, что <br />«тестовый текст» из некого общего буфера strget-strput берётся.</p>]]></content>
			<author>
				<name><![CDATA[creature.ws]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26105</uri>
			</author>
			<updated>2013-01-14T05:12:25Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=68470#p68470</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Инициализация переменной с помощью StrPut()]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=68468#p68468" />
			<content type="html"><![CDATA[<p>Да, почему не воспроизводятся именно пять символов, начиная со второго? Что-то ничего путного в голову не приходит.</p>]]></content>
			<author>
				<name><![CDATA[YMP]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=81</uri>
			</author>
			<updated>2013-01-14T05:05:24Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=68468#p68468</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Инициализация переменной с помощью StrPut()]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=68466#p68466" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>Var := &quot;ёжзикл тестовый текст&quot;

MsgBox, % &quot;Content = &quot; StrGet(&amp;Var, A_IsUnicode ? &quot;UTF-16&quot; : &quot;CP0&quot;) &quot;`nVar = &quot; Var

VarSetCapacity(Var2, StrPut(Var) * (A_IsUnicode ? 2 : 1))
StrPut(Var, &amp;Var2)
VarSetCapacity(Var2, -1)

MsgBox, % &quot;Content2 = &quot; StrGet(&amp;Var2, A_IsUnicode ? &quot;UTF-16&quot; : &quot;CP0&quot;) &quot;`nVar2 = &quot; Var2</code></pre></div><p>Я бы перефразировал — почему без использования <strong>varsetcapacity(var2, -1)</strong> содержимое <em>var2</em> таки отображается и отображется именно так <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p><p>Наверное, можно назвать эту особенность поведения «платой за динамическую слабую неявную типизацию и отсутствие необходимости инициализировать переменные».</p>]]></content>
			<author>
				<name><![CDATA[creature.ws]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26105</uri>
			</author>
			<updated>2013-01-14T04:13:59Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=68466#p68466</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Инициализация переменной с помощью StrPut()]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=68462#p68462" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>Var := &quot;ёжзикл тестовый текст&quot;

MsgBox, % &quot;Content = &quot; StrGet(&amp;Var, A_IsUnicode ? &quot;UTF-16&quot; : &quot;CP0&quot;) &quot;`nVar = &quot; Var

VarSetCapacity(Var2, StrPut(Var) * (A_IsUnicode ? 2 : 1))
StrPut(Var, &amp;Var2)

MsgBox, % &quot;Content2 = &quot; StrGet(&amp;Var2, A_IsUnicode ? &quot;UTF-16&quot; : &quot;CP0&quot;) &quot;`nVar2 = &quot; Var2</code></pre></div><p>Кто-то может сказать, почему во втором случае содержание переменной искажается?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2013-01-14T02:24:12Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=68462#p68462</id>
		</entry>
</feed>
