<?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=9553&amp;type=atom" />
	<updated>2014-04-30T16:29:21Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=9553</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Значение переменной значения переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=82495#p82495" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>Вообще-то не работает</p></blockquote></div><p>Исправил опечатку.</p>]]></content>
			<author>
				<name><![CDATA[bWRmeA]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=31915</uri>
			</author>
			<updated>2014-04-30T16:29:21Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=82495#p82495</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Значение переменной значения переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=82487#p82487" />
			<content type="html"><![CDATA[<p>Оно и понятно: если открыть в отладке variables and their contents, нам предстанут две переменные с именем &quot;<strong>c</strong>&quot;</p><p>Вывод: Punto Switcher - зло <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p><p>Мои пять копеек по этому вопросу: Соглашение по созданию псевдонимов все же необходимо, ибо как заметил <strong>bWRmeA</strong>, наличие непустой строки в переменной не есть аргумент, чтобы интерпретировать содержимое переменной как ссылку на другую переменную, даже если это и будет формально допустимым. Например, если а := 1, то &quot;1&quot; по сути тоже переменная, содержащая значение первого переданного скрипту параметра.<br /></p><div class="codebox"><pre><code>Global _:= &quot;ref_&quot;
a := 321
b = %_%a
c = %_%b
d = %_%c

MsgBox % Deref(d)

Deref(var) {
Return (InStr(var, _) &amp;&amp; var := SubStr(var, ++StrLen(_))) ? Deref(%var%) :  var
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Irbis]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27384</uri>
			</author>
			<updated>2014-04-30T14:19:41Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=82487#p82487</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Значение переменной значения переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=82483#p82483" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>bWRmeA пишет:</cite><blockquote><p>Если договориться о синтаксисе создания псевдонимов для переменных:<br /></p><div class="codebox"><pre><code>a := 1
b := &quot;%a%&quot;
c := &quot;%b%&quot;

MsgBox % Deref(с)

Deref(var) { ; без проверок правильности синтаксиса
    while InStr(var, &quot;%&quot;)
        Transform var, Deref, % var
    return var
}</code></pre></div><p>Другое вопрос, для чего это может быть нужно.</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>2014-04-30T14:08:05Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=82483#p82483</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Значение переменной значения переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=82480#p82480" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Malcev пишет:</cite><blockquote><p>Как в msgbox получить единицу используя только переменную &quot;c&quot;?<br />Так не работает.<br /></p><div class="codebox"><pre><code>a = 1
b = a
c = b
msgbox % %%c%%</code></pre></div></blockquote></div><br /><div class="codebox"><pre><code>a = 1
b = %a%
c = %b%
msgbox % c</code></pre></div>]]></content>
			<author>
				<name><![CDATA[ypppu]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=5974</uri>
			</author>
			<updated>2014-04-30T13:52:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=82480#p82480</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Значение переменной значения переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=82465#p82465" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>если вы подразумеваете ровно две вложенности</p></blockquote></div><p>Это код в первом посте подразумевает.<br /></p><div class="quotebox"><blockquote><p>Как точно узнать, что переменная является отсылкой на другую</p></blockquote></div><p>Средствами синтаксиса ahk? Никак.</p><div class="quotebox"><blockquote><p>Но почему-то выдаёт результат, и все время один, независимо от значения.</p></blockquote></div><p>Это признак что переменная не инициализирована, один результат для всех неинициализированных переменных.<br />То, что в переменной хранится строка, которую можно интерпретировать как имя существующей переменной, не является достаточным аргументом для утверждения, что переменная является отсылкой на другую.</p><p>Если договориться о синтаксисе создания псевдонимов для переменных:<br /></p><div class="codebox"><pre><code>a := 1
b := &quot;%a%&quot;
c := &quot;%b%&quot;

MsgBox % Deref(c)

Deref(var) { ; без проверок правильности синтаксиса
    while InStr(var, &quot;%&quot;)
        Transform var, Deref, % var
    return var
}</code></pre></div><p>Другое вопрос, для чего это может быть нужно.</p>]]></content>
			<author>
				<name><![CDATA[bWRmeA]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=31915</uri>
			</author>
			<updated>2014-04-29T23:10:41Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=82465#p82465</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Значение переменной значения переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=82464#p82464" />
			<content type="html"><![CDATA[<p>Мой ход мысли такой:<br /></p><div class="codebox"><pre><code>c := 1
MsgBox, % &amp;%c%</code></pre></div><p>Но почему-то выдаёт результат, и все время один, независимо от значения.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2014-04-29T23:02:44Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=82464#p82464</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Значение переменной значения переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=82462#p82462" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>bWRmeA пишет:</cite><blockquote><p>Вопрос некорректный, количество отсылок неизвестно изначально.</p></blockquote></div><p>Не совсем понял. Как же неизвестно, если вы подразумеваете ровно две вложенности?<br />Можно переформулировать вопрос. Как точно узнать, что переменная является отсылкой на другую?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2014-04-29T22:59:16Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=82462#p82462</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Значение переменной значения переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=82461#p82461" />
			<content type="html"><![CDATA[<p>В c, b&nbsp; лежат символы никак не указывающие на то, что они являются ссылкой на переменную, глубина вложенности задаётся логикой кода (бредового) примера, если бы в &quot;c&quot; была строка &quot;%%b%%&quot; тогда можно было бы сказать, что два deref не охватывают возможную неограниченную глубину вложенности в &quot;с&quot;.<br /></p><div class="quotebox"><blockquote><p>если отсылок неизвестное количество?</p></blockquote></div><p>Вопрос некорректный, количество отсылок неизвестно изначально.</p>]]></content>
			<author>
				<name><![CDATA[bWRmeA]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=31915</uri>
			</author>
			<updated>2014-04-29T22:50:25Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=82461#p82461</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Значение переменной значения переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=82458#p82458" />
			<content type="html"><![CDATA[<p>М-м-м... Я чего-то не понимаю?<br /></p><div class="codebox"><pre><code>a := 1
x := &quot;a&quot;
b := &quot;x&quot;
c := &quot;b&quot;

Transform c, Deref, % &quot;%&quot; c &quot;%&quot; ; c := %c%
Transform c, Deref, % &quot;%&quot; c &quot;%&quot; ; c := %c%

MsgBox % c</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2014-04-29T22:39:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=82458#p82458</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Значение переменной значения переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=82457#p82457" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p><strong>bWRmeA</strong>, а если отсылок неизвестное количество?</p></blockquote></div><p>Почему если? Оно и так неизвестно. Два derefa и две вложенности это случайное совпадение <img src="//forum.script-coding.com/img/smilies/tongue.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[bWRmeA]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=31915</uri>
			</author>
			<updated>2014-04-29T22:35:39Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=82457#p82457</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Значение переменной значения переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=82456#p82456" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>Это интересно. Но в каких случаях это вообще может быть применено?</p></blockquote></div><p>Затрудняюсь, по-моему чисто теоретический интерес. Обычно отсылка бывает всего одна, типа:<br /></p><div class="codebox"><pre><code>var1 := 1, var2 := 2, var3 := 3
str := &quot;var1|var2|var3&quot;
Loop, parse, str, |
   MsgBox, % %A_LoopField%</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2014-04-29T22:20:46Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=82456#p82456</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Значение переменной значения переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=82455#p82455" />
			<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>2014-04-29T22:15:59Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=82455#p82455</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Значение переменной значения переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=82454#p82454" />
			<content type="html"><![CDATA[<p><strong>bWRmeA</strong>, а если отсылок неизвестное количество?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2014-04-29T22:14:52Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=82454#p82454</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Значение переменной значения переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=82453#p82453" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>a := 1
b := &quot;a&quot;
c := &quot;b&quot;

Transform c, Deref, % &quot;%&quot; c &quot;%&quot; ; c := %c%
Transform c, Deref, % &quot;%&quot; c &quot;%&quot; ; c := %c%

MsgBox % c
</code></pre></div><div class="codebox"><pre><code>a := 1
b := &amp;a
c := &amp;b

MsgBox % StrGet(StrGet(c))</code></pre></div>]]></content>
			<author>
				<name><![CDATA[bWRmeA]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=31915</uri>
			</author>
			<updated>2014-04-29T22:03:51Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=82453#p82453</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Значение переменной значения переменной]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=82452#p82452" />
			<content type="html"><![CDATA[<p>Ладно, бывает:<br /></p><div class="codebox"><pre><code>
a := 1
b := a
c := b
msgbox % c
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2014-04-29T21:59:49Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=82452#p82452</id>
		</entry>
</feed>
