<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Инициализация переменной с помощью StrPut()]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=7975</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=7975&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Инициализация переменной с помощью StrPut()».]]></description>
		<lastBuildDate>Mon, 14 Jan 2013 07:55:21 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Инициализация переменной с помощью StrPut()]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=68472#p68472</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 14 Jan 2013 07:55:21 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=68472#p68472</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Инициализация переменной с помощью StrPut()]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=68470#p68470</link>
			<description><![CDATA[<p>Если в коде сообщения #1 закомментировать первый Msgbox, то var2 будет представлена в виде «ё», предположу, что <br />«тестовый текст» из некого общего буфера strget-strput берётся.</p>]]></description>
			<author><![CDATA[null@example.com (creature.ws)]]></author>
			<pubDate>Mon, 14 Jan 2013 05:12:25 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=68470#p68470</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Инициализация переменной с помощью StrPut()]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=68468#p68468</link>
			<description><![CDATA[<p>Да, почему не воспроизводятся именно пять символов, начиная со второго? Что-то ничего путного в голову не приходит.</p>]]></description>
			<author><![CDATA[null@example.com (YMP)]]></author>
			<pubDate>Mon, 14 Jan 2013 05:05:24 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=68468#p68468</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Инициализация переменной с помощью StrPut()]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=68466#p68466</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (creature.ws)]]></author>
			<pubDate>Mon, 14 Jan 2013 04:13:59 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=68466#p68466</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Инициализация переменной с помощью StrPut()]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=68462#p68462</link>
			<description><![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>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 14 Jan 2013 02:24:12 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=68462#p68462</guid>
		</item>
	</channel>
</rss>
