<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Ошибка окончания if {}]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=11435&amp;type=atom" />
	<updated>2016-03-23T15:20:58Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=11435</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Ошибка окончания if {}]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=101978#p101978" />
			<content type="html"><![CDATA[<p>Спасибо. Теперь, как всегда, непонятно осталось одно: как это я сам не смог сообразить.</p>]]></content>
			<author>
				<name><![CDATA[concept.ru]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33777</uri>
			</author>
			<updated>2016-03-23T15:20:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=101978#p101978</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Ошибка окончания if {}]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=101977#p101977" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>if x =
{
	gui add, edit, w256 vx, Переменная
	gui add, button, xp+144 yp+26, Отмена
	gui add, button, Default xp+65, Ввести
	gui show,,Ввод
}
Else 
	Gosub, Метка   
return

Метка:
	MsgBox %x%
	return
	
ButtonОтмена:
	exitapp

ButtonВвести:
	GuiClose:
	Gui Submit
	File = C:\Users\AB\Desktop\forum.ahk
	Str = x=%x%
	{
		If A_Index = 1
			Text .= Str . &quot;`n&quot;
		Text .= A_LoopReadLine . &quot;`n&quot;
	}
	FileDelete, %File%
	FileAppend, %Text%, %File%
	Gosub, Метка 
	exitapp</code></pre></div><div class="quotebox"><cite>concept.ru пишет:</cite><blockquote><p>А нужно, чтобы выполнение шло дальше</p></blockquote></div><p>То что дальше, идёт теперь в метке &quot;Метка&quot;.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2016-03-23T14:15:17Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=101977#p101977</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Ошибка окончания if {}]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=101976#p101976" />
			<content type="html"><![CDATA[<p>Спасибо.<br />Только при повторном запуске, при добавившейся строке, скрипт доходит до return, вынесенный теперь за if {}, и чего-то ждёт от пользователя. А нужно, чтобы выполнение шло дальше, с MsgBox %x%.<br />И ещё: а что являлось метками, кот. были внутри блока if?</p>]]></content>
			<author>
				<name><![CDATA[concept.ru]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33777</uri>
			</author>
			<updated>2016-03-23T14:00:02Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=101976#p101976</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Ошибка окончания if {}]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=101974#p101974" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>if x =
{
	gui add, edit, w256 vx, Переменная
	gui add, button, xp+144 yp+26, Отмена
	gui add, button, Default xp+65, Ввести
	gui show,,Ввод
}
return

ButtonОтмена:
	exitapp

ButtonВвести:
	GuiClose:
	Gui Submit
	File = C:\Users\AB\Desktop\forum.ahk
	Str = x=%x%
	{
		If A_Index = 1
			Text .= Str . &quot;`n&quot;
		Text .= A_LoopReadLine . &quot;`n&quot;
	}
	FileDelete, %File%
	FileAppend, %Text%, %File%
	MsgBox %x%
	exitapp</code></pre></div><p>Не надо метки помещать внутрь блока if.</p>]]></content>
			<author>
				<name><![CDATA[serzh82saratov]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27879</uri>
			</author>
			<updated>2016-03-23T11:04:32Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=101974#p101974</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Ошибка окончания if {}]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=101973#p101973" />
			<content type="html"><![CDATA[<p>Здравствуйте!<br />Задача у скрипта: добавить строку в самого себя.<br /></p><div class="codebox"><pre><code>if x=
  {
  gui add, edit, w256 vx, Переменная
  gui add, button, xp+144 yp+26, Отмена
  gui add, button, Default xp+65, Ввести
  gui show,,Ввод
  return
  ButtonОтмена:
	exitapp
  ButtonВвести:
  GuiClose:
	Gui Submit
  File = C:\Users\AB\Desktop\forum.ahk
  Str = x=%x%
  Loop, Read, %File%
	{
      If A_Index = 1
        Text .= Str . &quot;`n&quot;
	  Text .= A_LoopReadLine . &quot;`n&quot;
	}
  FileDelete, %File%
  FileAppend, %Text%, %File%
  }
MsgBox %x%
exitapp</code></pre></div><p>Скрипт даёт ошибку на закрывающую }, относящуюся к первому if, останавливается, приходится срубать. При этом задачу выполняет.<br />Не пойму, почему скрипту не нравится }, и прошу помощи.<br />P.S. InputBox в этом скрипте не годится.</p>]]></content>
			<author>
				<name><![CDATA[concept.ru]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=33777</uri>
			</author>
			<updated>2016-03-23T10:48:56Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=101973#p101973</id>
		</entry>
</feed>
