<?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=14910&amp;type=atom" />
	<updated>2019-08-12T19:07:32Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=14910</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Регулярные выражения]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=135524#p135524" />
			<content type="html"><![CDATA[<p>Для примера:<br /></p><div class="codebox"><pre><code>SendImageToImgur(imagePath, ClientID)  {
   oFile := FileOpen(imagePath, &quot;r&quot;)
   oFile.Pos := 0
   oFile.RawRead(buff, size := oFile.length)
   oFile.Close()
   strBase64 := CryptBinaryToStringBASE64(&amp;buff, size, true)
   http := ComObjCreate(&quot;Msxml2.XMLHTTP&quot;)
   http.open(&quot;POST&quot;, &quot;https://api.imgur.com/3/image&quot;, true)
   http.onreadystatechange := Func(&quot;StateChange&quot;).Bind(http)
   http.SetRequestHeader(&quot;authorization&quot;, &quot;Client-ID &quot; . ClientID)
   http.send(strBase64)
   VarSetCapacity(strBase64, 0), VarSetCapacity(buff, 0)
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2019-08-12T19:07:32Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=135524#p135524</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Регулярные выражения]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=135523#p135523" />
			<content type="html"><![CDATA[<p>У меня проблем вроде не возникает, я вообще всё внутри функций делаю, там всё обнуляется автоматически. По идее, метод Send не завершается, пока всё, что в нём указано, не будет отправлено.<br />Lexikos, думаю, для простоты так делает, чтобы было понятно новичкам.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2019-08-12T19:04:48Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=135523#p135523</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Регулярные выражения]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=135521#p135521" />
			<content type="html"><![CDATA[<p>Ты уверен, что так можно делать?<br />У меня в итоге залился битый mp4 файл.<br />Сейчас я обнуляю, после того, как получаю ответ от сервера, что эта часть файла загружена, а не сразу после отправки.<br />Кстати, <strong>Lexikos</strong> в своих примерах тоже использует Global:<br /><a href="https://github.com/Lexikos/ActiveScript.ahk/blob/master/Example_JsRT.ahk">https://github.com/Lexikos/ActiveScript … e_JsRT.ahk</a></p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2019-08-12T18:42:30Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=135521#p135521</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Регулярные выражения]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=135519#p135519" />
			<content type="html"><![CDATA[<p>А в чём проблема? После Send и обнуляй.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2019-08-12T17:56:18Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=135519#p135519</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Регулярные выражения]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=135518#p135518" />
			<content type="html"><![CDATA[<p>Так надо еще body%A_Index% обнулять, а его можно обнулить только после окончания отправки данных.</p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2019-08-12T17:41:08Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=135518#p135518</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Регулярные выражения]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=135517#p135517" />
			<content type="html"><![CDATA[<p>Может, ещё внутри функции обнулить нужно, чтобы память освободить, не уверен.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2019-08-12T17:32:35Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=135517#p135517</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Регулярные выражения]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=135516#p135516" />
			<content type="html"><![CDATA[<p>Так не проще:<br /></p><div class="codebox"><pre><code>#Persistent
loop 5
{
   req%A_Index% := ComObjCreate(&quot;Msxml2.XMLHTTP&quot;)
   req%A_Index%.open(&quot;GET&quot;, &quot;https://autohotkey.com/download/1.1/version.txt&quot;, true)
   req%A_Index%.onreadystatechange := Func(&quot;Ready&quot;).Bind(req%A_Index%)
   req%A_Index%.send()
   req%A_Index% := &quot;&quot;
}

Ready(req)
{
   if (req.readyState = 4)
      MsgBox, % req.responseText
}</code></pre></div><p>?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2019-08-12T17:22:33Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=135516#p135516</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Регулярные выражения]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=135515#p135515" />
			<content type="html"><![CDATA[<p>Сравни:<br /></p><div class="codebox"><pre><code>#Persistent
loop 1
{
   req%A_Index% := ComObjCreate(&quot;Msxml2.XMLHTTP&quot;)
   req%A_Index%.open(&quot;GET&quot;, &quot;https://autohotkey.com/download/1.1/version.txt&quot;, true)
   req%A_Index%.onreadystatechange := Func(&quot;Ready&quot;).Bind(A_Index)
   req%A_Index%.send()
}
sleep 5000
msgbox % IsObject(req1)


Ready(Index)
{
   Global
   if (req%Index%.readyState = 4)
      req%Index% := &quot;&quot;    ;   делаем какие-либо действия связанные с этим объектом, например обнуляем
   return
}
</code></pre></div><div class="codebox"><pre><code>#Persistent
loop 1
{
   req%A_Index% := ComObjCreate(&quot;Msxml2.XMLHTTP&quot;)
   req%A_Index%.open(&quot;GET&quot;, &quot;https://autohotkey.com/download/1.1/version.txt&quot;, true)
   req%A_Index%.onreadystatechange := Func(&quot;Ready&quot;).Bind(req%A_Index%)
   req%A_Index%.send()
}
sleep 5000
msgbox % IsObject(req1)

Ready(Index)
{
   if (Index.readyState = 4)
      Index := &quot;&quot;    ;   делаем какие-либо действия связанные с этим объектом, например обнуляем
   return
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2019-08-12T17:15:24Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=135515#p135515</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Регулярные выражения]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=135514#p135514" />
			<content type="html"><![CDATA[<p>Приводишь пример, который проверить проблематично, попроще нет? <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2019-08-12T17:05:47Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=135514#p135514</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Регулярные выражения]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=135513#p135513" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Если забиндить req%A_Index% вместо A_Index, не будет то же самое без global?</p></blockquote></div>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2019-08-12T17:04:50Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=135513#p135513</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Регулярные выражения]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=135512#p135512" />
			<content type="html"><![CDATA[<p>У меня в коде при заливке на filemail файл отправляется частями.<br />И после отправки определенной части переменную в которой она хранится следует удалять, чтобы не съедалась память, то есть я обнулял HTTP%Index% и body%Index%.<br />Без Global у меня такое не получалось:<br /><a href="http://forum.script-coding.com/viewtopic.php?id=13727">http://forum.script-coding.com/viewtopic.php?id=13727</a></p>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2019-08-12T17:01:10Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=135512#p135512</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Регулярные выражения]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=135511#p135511" />
			<content type="html"><![CDATA[<p>А что этот пример демонстрирует? Так сразу и не понятно. Если забиндить req%A_Index% вместо A_Index, не будет то же самое без global? И как это увидеть?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2019-08-12T16:56:09Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=135511#p135511</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Регулярные выражения]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=135510#p135510" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>#Persistent
loop 5
{
   req%A_Index% := ComObjCreate(&quot;Msxml2.XMLHTTP&quot;)
   req%A_Index%.open(&quot;GET&quot;, &quot;https://autohotkey.com/download/1.1/version.txt&quot;, true)
   req%A_Index%.onreadystatechange := Func(&quot;Ready&quot;).Bind(A_Index)
   req%A_Index%.send()
}

Ready(Index)
{
   Global
   if (req%Index%.readyState = 4)
      req%Index% := &quot;&quot;    ;   делаем какие-либо действия связанные с этим объектом, например обнуляем
   return
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Malcev]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26930</uri>
			</author>
			<updated>2019-08-12T16:46:22Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=135510#p135510</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Регулярные выражения]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=135509#p135509" />
			<content type="html"><![CDATA[<p>А что там с невозможностью избежать глобальных переменных?</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2019-08-12T16:22:11Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=135509#p135509</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Регулярные выражения]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=135508#p135508" />
			<content type="html"><![CDATA[<p><strong>Malcev</strong>, ну уговорил, с очень большим текстом можно и подумать, какой вариант применить. <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2019-08-12T16:19:57Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=135508#p135508</id>
		</entry>
</feed>
