<?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=7714&amp;type=atom" />
	<updated>2012-10-21T09:03:33Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=7714</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK:Сохранение переменной в конфигурационный файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=64939#p64939" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>Loop, 2
   IniRead, Input_%A_Index%
          , % A_ScriptDir &quot;\&quot;SubStr(A_ScriptName, 1, -4)&quot;.ini&quot;
          , Set
          , Input_%A_Index%
          , % A_Index=1 ? &quot;temporary empty field&quot;:&quot;&quot;

Gui, Add, Edit, vInput_1 x+10 w200 h18, % Input_1
Gui, Add, Hotkey, vInput_2 x+15 w45, % Input_2
Gui, Add, Button, x10 y40, Save

ShowGUI:
   Hotkey, Ctrl &amp; Enter, ShowGUI, Off ; call GUI hotkey
   If % Input_2&lt;&gt;&quot;ERROR&quot;
      Hotkey, % &quot;$&quot;Input_2, InputText, Off
   Gui, Show,, Test
   Return

ButtonSave:
   Gui, Submit
   Gui, Hide
   Loop, 2
      If !Input_%A_Index%
      {
         MsgBox, 262160, % &quot;field: &quot;A_Index, % &quot;make input!&quot;, 1
         Goto, ShowGUI
      }
   Loop, 2
      IniWrite, % Input_%A_Index%
              , % A_ScriptDir &quot;\&quot;SubStr(A_ScriptName, 1, -4)&quot;.ini&quot;
              , Set
              , Input_%A_Index%
   Hotkey, Ctrl &amp; Enter, ShowGUI, On
   Hotkey, % &quot;$&quot;Input_2, InputText, On
   Return

InputText:
   SendInput, % &quot;{Raw}&quot;Input_1
   Return

GuiClose:
   ExitApp</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Grey]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25792</uri>
			</author>
			<updated>2012-10-21T09:03:33Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=64939#p64939</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:Сохранение переменной в конфигурационный файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=64930#p64930" />
			<content type="html"><![CDATA[<p><strong>Grey</strong>, благодарю, еще один нюанс, как вывести текст по нажатию клавиши из переменных в sendinput?</p>]]></content>
			<author>
				<name><![CDATA[[CM]White]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=28415</uri>
			</author>
			<updated>2012-10-21T03:01:01Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=64930#p64930</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:Сохранение переменной в конфигурационный файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=64897#p64897" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>Loop, 2
   IniRead, Input_%A_Index%
          , % A_ScriptDir &quot;\&quot;SubStr(A_ScriptName, 1, -4)&quot;.ini&quot;
          , Set
          , Input_%A_Index%
          , % A_Index=1 ? &quot;temporary empty field&quot;:&quot;&quot;

BuildGUI:
   ;Gui, Add, Picture, xm y+10
   Gui, Add, Edit, vInput_1 x+10 w200 h18, % Input_1
   Gui, Add, Hotkey, vInput_2 x+15 w45, % Input_2
   Gui, Add, Button, x10 y40, Save
   Gui, Show,, Test
   Return

ButtonSave:
   Gui, Submit
   Gui, Destroy
   Loop, 2
      If !Input_%A_Index%
      {
         MsgBox, 262160,, % &quot;make input! (field: &quot;A_Index &quot;)&quot;, 1
         Goto, BuildGUI
      }
   Loop, 2
      IniWrite, % Input_%A_Index%
              , % A_ScriptDir &quot;\&quot;SubStr(A_ScriptName, 1, -4)&quot;.ini&quot;
              , Set
              , Input_%A_Index%
   ExitApp

GuiClose:
   ExitApp</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Grey]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=25792</uri>
			</author>
			<updated>2012-10-20T16:18:56Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=64897#p64897</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:Сохранение переменной в конфигурационный файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=64890#p64890" />
			<content type="html"><![CDATA[<p><span class="postimg"><img src="http://s2.ipicture.ru/uploads/20121020/Hk82R9bR.jpg" alt="http://s2.ipicture.ru/uploads/20121020/Hk82R9bR.jpg" /></span><br />Нужно сохранить значения переменных обоих полей в конфигурационный файл, но у меня с этим накладочка произошла <br /></p><div class="codebox"><pre><code>Gui,Add,Picture ,xm y+10 
Gui,Add,Edit,vText1 x+10 w200 h18 
Gui,Add,Hotkey,vmyhotkey1 x+15 w45
Gui,Add, Button, x10 y40 , Save
Gui,Show,c000000,Тест
Return

ButtonSave:
IfNotExist, Тест.ini ; Если файла ini не находит - создает, с днфолтными параметрами
{
FileAppend, [Тест] 
IniWrite, %myhotkey1%, %A_ScriptDir%\тест.ini, Options, vmyhotkey1
}
   GuiControlGet, myhotkey1,, myhotkey1
   GuiControlGet, Text1,, Text1
   Gui, Destroy
   Hotkey, $%myhotkey1%, textdown1, On
   Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[[CM]White]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=28415</uri>
			</author>
			<updated>2012-10-20T13:49:57Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=64890#p64890</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK:Сохранение переменной в конфигурационный файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=64883#p64883" />
			<content type="html"><![CDATA[<p>Кусок ссылки на раздел статьи содержащий ответ : <a href="http://l.autohotkey.net/docs/commands/Gui.htm#Sub">Gui, Submit</a></p>]]></content>
			<author>
				<name><![CDATA[creature.ws]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26105</uri>
			</author>
			<updated>2012-10-20T11:08:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=64883#p64883</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK:Сохранение переменной в конфигурационный файл]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=64879#p64879" />
			<content type="html"><![CDATA[<p>Возникла проблема при сохранении/считывании переменных, кусок скрипта<br /></p><div class="codebox"><pre><code>Gui,Add,Edit,vText1 x+10 w200 h18 
Gui,Add,Hotkey,vmyhotkey1 x+15 w45
Gui,Add, Button, x10 y50 , Save</code></pre></div>]]></content>
			<author>
				<name><![CDATA[[CM]White]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=28415</uri>
			</author>
			<updated>2012-10-20T10:55:05Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=64879#p64879</id>
		</entry>
</feed>
