<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: iniRead&iniWrite]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=6574&amp;type=atom" />
	<updated>2011-12-21T09:23:41Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=6574</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: iniRead&iniWrite]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=54820#p54820" />
			<content type="html"><![CDATA[<p>Мне кажется, лучше один раз проверить наличие файла, чем несколько десятков неудачных попыток чтения. Ну, хотя бы чисто эстетически. <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /> Да и прямое задание дефолтных значений более наглядно. Хотя кому как, конечно.</p>]]></content>
			<author>
				<name><![CDATA[YMP]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=81</uri>
			</author>
			<updated>2011-12-21T09:23:41Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=54820#p54820</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: iniRead&iniWrite]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=54818#p54818" />
			<content type="html"><![CDATA[<p>Несколько советов.<br />&quot;Если файла нет, задаём значения по умолчанию.&quot; лишнее, последний параметр IniRead как раз присвоение при ошибке чтения.<br /></p><div class="codebox"><pre><code>IniRead, F1, %A_ScriptDir%\config.ini, Skill, F1, 0
IniRead, Length1, %A_ScriptDir%\config.ini, Skill, Length1, 2</code></pre></div><p>%A_ScriptDir% тоже можно не писать, т.к. используется по умолчанию.<br />Вместо x222 y58 можно писать xp+12 (12 пикселей правей предыдущего элемента), а y58 и вовсе опустить, т.к. xp+12 подразумевает ту же строку.</p>]]></content>
			<author>
				<name><![CDATA[Zohann]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26234</uri>
			</author>
			<updated>2011-12-21T06:57:39Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=54818#p54818</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: iniRead&iniWrite]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=54816#p54816" />
			<content type="html"><![CDATA[<p>Спасибо YMP за помощь в коде. Все теперь работает. Вот пример рабочей схемы.</p><div class="codebox"><pre><code>IfExist, %A_ScriptDir%\config.ini   ; Если есть файл настроек,
    Gosub, ReadSettings             ; читаем настройки.
Else    ; Если файла нет, задаём значения по умолчанию.
{
    F1 = 0
    Length1 = 2
}

Gui, Add, Button, x120 y310 w210 h40 , Save
 
Gui, Add, Tab, x5 y5, Tab1|Tab2|Tab3|Tab4|Tab5
Gui, Tab, Tab1

Gui, Add, Text, x10 y58 w210 h20 , F1: умение(сек)
Gui, Add, Edit, x222 y58 w40 h20 vLength1, %Length1%
Gui, Add, Checkbox, x280 y58 vF1 Checked%F1%, Использовать
Gui, Show
Return

ReadSettings:   ; Чтение настроек.
    IniRead, F1, %A_ScriptDir%\config.ini, Skill, F1
    IniRead, Length1, %A_ScriptDir%\config.ini, Skill, Length1
Return

ButtonSave:     ; Сохранение настроек.
    Gui, Submit, NoHide
    IniWrite, %F1%, %A_ScriptDir%\config.ini, Skill, F1
    IniWrite, %Length1%, %A_ScriptDir%\config.ini, Skill, Length1
Return

GuiClose:       ; Выход из программы при закрытии окна Gui.
    ExitApp</code></pre></div>]]></content>
			<author>
				<name><![CDATA[kamaz]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27017</uri>
			</author>
			<updated>2011-12-21T04:55:01Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=54816#p54816</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: iniRead&iniWrite]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=54803#p54803" />
			<content type="html"><![CDATA[<p>OFF, редко ящики просматриваю.</p>]]></content>
			<author>
				<name><![CDATA[Zohann]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26234</uri>
			</author>
			<updated>2011-12-20T10:37:56Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=54803#p54803</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: iniRead&iniWrite]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=54801#p54801" />
			<content type="html"><![CDATA[<p>OFF: </p><div class="quotebox"><cite>Zohann пишет:</cite><blockquote><p>Вах, что я вижу, я разработчик!))) Спасибо!</p></blockquote></div><p>Вы разве письмо не получали на адрес, с которого регистрировались?</p>]]></content>
			<author>
				<name><![CDATA[alexii]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=1844</uri>
			</author>
			<updated>2011-12-20T08:15:45Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=54801#p54801</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: iniRead&iniWrite]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=54799#p54799" />
			<content type="html"><![CDATA[<p>Так правильнее<br /></p><div class="codebox"><pre><code>Gui, Add, Edit, vLength1 
Gui, Add, Button, gSaveSettigs, Сохранить
Gui, Add, Button, x+5, Считать
Gui, Show
Return
SaveSettigs:
   Gui, Submit, NoHide
   IniWrite, %Length1%, config.ini, Skill, vLength1
Return
ButtonСчитать:
IniRead, Length, config.ini, Skill, vLength1
MsgBox %Length%
Return</code></pre></div><p>Вах, что я вижу, я разработчик!))) Спасибо!</p>]]></content>
			<author>
				<name><![CDATA[Zohann]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26234</uri>
			</author>
			<updated>2011-12-20T07:57:34Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=54799#p54799</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: iniRead&iniWrite]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=54798#p54798" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>creature.ws пишет:</cite><blockquote><div class="codebox"><pre><code>Gui, Add, Edit, x222 y58 w40 h20 vLength1 gSaveSettigs, 2
Return
SaveSettigs:
   Gui, Submit, NoHide
   IniWrite, %Length1%, %A_ScriptDir%\config.ini, Skill, vLength1
Return</code></pre></div></blockquote></div><p>Данный способ тоже не работает. не понимаю метку gSaveSettigs - программа выдает ошибку в данной строке.</p><p>с сохранением более менее понятно - он ставит 1 если использовать, и ставит Error если нет. Но проблема с считыванием - IniRead не работает.</p>]]></content>
			<author>
				<name><![CDATA[kamaz]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27017</uri>
			</author>
			<updated>2011-12-20T07:24:38Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=54798#p54798</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: iniRead&iniWrite]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=54777#p54777" />
			<content type="html"><![CDATA[<p>Прошу прощения, а что это за игра?</p>]]></content>
			<author>
				<name><![CDATA[ilya20069]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26683</uri>
			</author>
			<updated>2011-12-19T15:41:30Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=54777#p54777</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: iniRead&iniWrite]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=54774#p54774" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>Gui, Add, Edit, x222 y58 w40 h20 vLength1 gSaveSettigs, 2
Return
SaveSettigs:
   Gui, Submit, NoHide
   IniWrite, %Length1%, %A_ScriptDir%\config.ini, Skill, vLength1
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[creature.ws]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26105</uri>
			</author>
			<updated>2011-12-19T14:46:36Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=54774#p54774</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: iniRead&iniWrite]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=54773#p54773" />
			<content type="html"><![CDATA[<p>Ну аналогично ранее написанному.<br /></p><div class="codebox"><pre><code>Gui, Add, Edit, x222 y58 w40 h20 vLength1, 2
IniWrite, %Length1%, %A_ScriptDir%\config.ini, Skill, vLength1</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Zohann]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26234</uri>
			</author>
			<updated>2011-12-19T14:40:39Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=54773#p54773</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: iniRead&iniWrite]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=54770#p54770" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>kamaz пишет:</cite><blockquote><p>Вот проблемка еще со считыванием временного значения. Его как то сохранить можно?</p></blockquote></div><p>Считыванием откуда?</p>]]></content>
			<author>
				<name><![CDATA[YMP]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=81</uri>
			</author>
			<updated>2011-12-19T13:37:51Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=54770#p54770</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: iniRead&iniWrite]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=54769#p54769" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>YMP пишет:</cite><blockquote><p>Gui, Submit сразу всё считывает, заполняет все переменные.<br />Временное значение — это что?</p></blockquote></div><p>не правильно выразился, не временное а временнОе - то есть заданное время для повторения цикла.</p>]]></content>
			<author>
				<name><![CDATA[kamaz]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27017</uri>
			</author>
			<updated>2011-12-19T13:21:54Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=54769#p54769</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: iniRead&iniWrite]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=54768#p54768" />
			<content type="html"><![CDATA[<p>Gui, Submit сразу всё считывает, заполняет все переменные.<br />Временное значение — это что?</p>]]></content>
			<author>
				<name><![CDATA[YMP]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=81</uri>
			</author>
			<updated>2011-12-19T13:12:48Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=54768#p54768</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: iniRead&iniWrite]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=54766#p54766" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>YMP пишет:</cite><blockquote><p>Вероятно, переменные F1 и т.д. пустые, т.к. в них не считаны данные из GUI. Добавьте считывание:</p></blockquote></div><p>Спасибо - это заработало.<br />Вот проблемка еще со считыванием временного значения. Его как то сохранить можно?</p><p>И iniread не работает.</p><p>у меня есть владка, где нет CheckBox - только поля с Edit. их как то можно сохранять? Метка на них тоже присутствует.</p>]]></content>
			<author>
				<name><![CDATA[kamaz]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27017</uri>
			</author>
			<updated>2011-12-19T12:47:12Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=54766#p54766</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: iniRead&iniWrite]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=54765#p54765" />
			<content type="html"><![CDATA[<p>Вероятно, переменные F1 и т.д. пустые, т.к. в них не считаны данные из GUI. Добавьте считывание:<br /></p><div class="codebox"><pre><code>ButtonSave:
    Gui, Submit, NoHide
    IniWrite, %MonsterTab%, %A_ScriptDir%\config.ini, Skill, vMonster
    IniWrite, %F1%, %A_ScriptDir%\config.ini, Skill, vLength1
    IniWrite, %F2%, %A_ScriptDir%\config.ini, Skill, vLength2
    IniWrite, %F3%, %A_ScriptDir%\config.ini, Skill, vLength3
    IniWrite, %F4%, %A_ScriptDir%\config.ini, Skill, vLength4
Return</code></pre></div>]]></content>
			<author>
				<name><![CDATA[YMP]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=81</uri>
			</author>
			<updated>2011-12-19T12:42:38Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=54765#p54765</id>
		</entry>
</feed>
