<?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=6920&amp;type=atom" />
	<updated>2012-03-12T20:38:49Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=6920</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Глобальные переменные в процедурах. Как сделать?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=57761#p57761" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Amadare пишет:</cite><blockquote><p>А где можно почитать про конструкции вида <em>&quot;% (x ? x : 0) . &quot; &quot; . (y ? y : 0)&quot;</em>?</p></blockquote></div><p>Всё там же <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /> в справке. <em>Переменные и выражения, тернарный оператор, конкатенация.</em></p>]]></content>
			<author>
				<name><![CDATA[creature.ws]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26105</uri>
			</author>
			<updated>2012-03-12T20:38:49Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=57761#p57761</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Глобальные переменные в процедурах. Как сделать?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=57760#p57760" />
			<content type="html"><![CDATA[<p>Спасибо, <strong>creature.ws</strong>. Так оно выглядит получше. И даже есть ключевое (то, что мне было нужно) <em>&quot;global x, y&quot;</em>. А где можно почитать про конструкции вида <em>&quot;% (x ? x : 0) . &quot; &quot; . (y ? y : 0)&quot;</em>?</p><p>Спасибо, <strong>teadrinker</strong>. Осмотрел код, пролистал предложенную документацию, все стало понятнее. Дальше буду читать внимательнее.</p>]]></content>
			<author>
				<name><![CDATA[Amadare]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27709</uri>
			</author>
			<updated>2012-03-12T20:22:56Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=57760#p57760</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Глобальные переменные в процедурах. Как сделать?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=57759#p57759" />
			<content type="html"><![CDATA[<p><strong>Amadare</strong>, твой вариант правилен в таком виде:<br /></p><div class="codebox"><pre><code>LWIN::Set(x, y)
RWIN::View(x, y)
 
Set(ByRef _x, ByRef _y) 
{
    MouseGetPos, x, y
    _x := x   ; или _x = %x%
    _y := y   ; или _y = %y%
}
 
View(x_,y_)
{
    MsgBox, %x_% %y_%
}</code></pre></div><p>Тебе нужно прочитать справку по <a href="http://script-coding.com/AutoHotkey/Variables.1.0.46.07.html#1">переменным</a> и по <a href="http://l.autohotkey.net/docs/Functions.htm">функциям</a>.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2012-03-12T20:09:51Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=57759#p57759</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Глобальные переменные в процедурах. Как сделать?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=57758#p57758" />
			<content type="html"><![CDATA[<div class="quotebox"><blockquote><p>Тестовая программка. Должна запоминать координаты курсора при нажатии левого Win и выводить их в MsgBox&#039;e при нажатии правого</p></blockquote></div><div class="codebox"><pre><code>LWIN::MouseGetPos x, y
RWIN::MsgBox % (x ? x : 0) . &quot; &quot; . (y ? y : 0)</code></pre></div><p>//upd <em>исправлено во имя добра</em></p>]]></content>
			<author>
				<name><![CDATA[creature.ws]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26105</uri>
			</author>
			<updated>2012-03-12T20:04:04Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=57758#p57758</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Глобальные переменные в процедурах. Как сделать?]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=57755#p57755" />
			<content type="html"><![CDATA[<p>Доброго времени суток. Начал разбираться в AutoHotkey совсем недавно, поэтому вопрос будет немного простоватым, но нагуглить ответ никак не мог...<br />Тестовая программка. Должна запоминать координаты курсора при нажатии левого Win и выводить их в MsgBox&#039;e при нажатии правого. При чём, если координаты не были заданы, должны выводится нули. <br />Почему-то не работает - <em>выдает нули все время</em>. Что я сделал не так?</p><div class="codebox"><pre><code>x=0
y=0

LWIN::Set(x, y)
RWIN::View(x, y)

Set(_x,_y) 
{
	MouseGetPos x,y
	%_x%=%x%
	%_y%=%y%
}

View(x_,y_)
{
	MsgBox, %x_% %y_%
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Amadare]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27709</uri>
			</author>
			<updated>2012-03-12T19:27:22Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=57755#p57755</id>
		</entry>
</feed>
