<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Замена переменных в загружаемом файле]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=16838</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=16838&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Замена переменных в загружаемом файле».]]></description>
		<lastBuildDate>Wed, 22 Dec 2021 12:43:10 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Замена переменных в загружаемом файле]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=151362#p151362</link>
			<description><![CDATA[<p><strong>andrey.a.polyakov.b2c</strong>, если бы привели примерный текст файла, и что вы хотите с ним сделать, было бы понятнее.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Wed, 22 Dec 2021 12:43:10 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=151362#p151362</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Замена переменных в загружаемом файле]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=151359#p151359</link>
			<description><![CDATA[<p>Сделал обходной путь через парсинг ошибки. Если есть другой способ то поделитесь пожалуйста, а я делюсь своим способом.<br /></p><div class="codebox"><pre><code>StrDeref(str) {
    r_f := false
    while r_f = false ; проверка окончания цикла
    {
        type_m := 0
        try {
            Transform,str,Deref,%str%
            r_f := true	
            return,% str	
        }
        catch e {
            type_m := RegExMatch(e.message,&quot;illegal character:`n&quot;&quot;(.*)\[(.*)\]&quot;&quot;&quot;,err) &gt; 0 ? 1 : RegExMatch(e.message,&quot;illegal character:`n&quot;&quot;(.*)\.(.*)&quot;&quot;&quot;,err) &gt; 0 ? 2 : 0           
            if (err &lt;&gt; &quot;&quot;) {
                RegExMatch(err2, &quot;\$(.*)&quot;,err_p)
                if (err_p = &quot;&quot;) {
                    zm := %err1%[err2]
                    er := type_m = 2 ? &quot;%&quot; . err1 &quot;\.&quot; err2 . &quot;%&quot; : &quot;%&quot; . err1 &quot;\[&quot; err2 . &quot;\]%&quot;
                }
                else {
                    zm := %err1%[%err_p1%]
                    er := type_m = 2 ? &quot;%&quot; . err1 &quot;.\&quot; err2 . &quot;%&quot; : &quot;%&quot; . err1 &quot;\[\&quot; err2 . &quot;\]%&quot;
                }
                str := RegExReplace(str,er,zm,all)
            }
            else 
                return, e.message
        }	
    }	
    return,% str	
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (andrey.a.polyakov.b2c)]]></author>
			<pubDate>Wed, 22 Dec 2021 12:09:05 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=151359#p151359</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Замена переменных в загружаемом файле]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=151315#p151315</link>
			<description><![CDATA[<p>Добрый день уважаемые форумчане.<br />У меня такая проблема, ни как не могу понять как из файла загрузить текст так что бы переменные в нем заменялись на значения этих переменных.<br />Если просто в файле переменная например:</p><p><strong>Файл </strong> test.txt<br /><strong>Содержимое</strong>: Привет %name%. Как дела?</p><p>То тут все понятно, код следующий:<br /></p><div class="codebox"><pre><code> FileRead,txt_file,test.txt
Transform, txt_file, Deref, %txt_file% 
MsgBox, %txt_file%</code></pre></div><p>Но у меня проблема в массивах.<br />То есть у меня в файле могут быть переменные вида user.name или user[&quot;name&quot;]<br />Как вот именно такие переменные вывести.<br />Помогите решить проблему пожалуйста.</p>]]></description>
			<author><![CDATA[null@example.com (andrey.a.polyakov.b2c)]]></author>
			<pubDate>Mon, 20 Dec 2021 05:47:28 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=151315#p151315</guid>
		</item>
	</channel>
</rss>
