<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: WinHttp.WinHttpRequest.5.1]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=14193</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=14193&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: WinHttp.WinHttpRequest.5.1».]]></description>
		<lastBuildDate>Sat, 31 Oct 2020 09:26:48 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: WinHttp.WinHttpRequest.5.1]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=143033#p143033</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>A function may contain externally-called subroutines such as timers, GUI g-labels, and menu items. ... However, the following limitations apply:<br />&nbsp; &nbsp; Such subroutines should use only static and global variables (not locals) if their function is ever called normally. ...<br />&nbsp; &nbsp; When a function is entered by a subroutine thread, any references to dynamic variables made by that thread are treated as globals (including commands that create arrays).</p></blockquote></div><p><a href="https://www.autohotkey.com/docs/Functions.htm#gosub">https://www.autohotkey.com/docs/Functions.htm#gosub</a></p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Sat, 31 Oct 2020 09:26:48 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=143033#p143033</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: WinHttp.WinHttpRequest.5.1]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=143010#p143010</link>
			<description><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Часть паттерна .* запинается на первом переносе строк</p></blockquote></div><p>Скорее не запинается, а работает как описано в №18.<br /></p><div class="codebox"><pre><code>Text = 111`r`n222`r`n___333___`r`n444`r`n555

MsgBox % RegExReplace(Text, &quot;.*(333).*&quot;, &quot;$1&quot;)</code></pre></div><div class="quotebox"><cite>Malcev пишет:</cite><blockquote><p>Потестировал, наверное действительно баг.</p></blockquote></div><p>Да, любопытно.</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Fri, 30 Oct 2020 14:31:06 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=143010#p143010</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: WinHttp.WinHttpRequest.5.1]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=143003#p143003</link>
			<description><![CDATA[<p>Потестировал, наверное действительно баг.<br />Напишу на оффоруме.<br /></p><div class="codebox"><pre><code>#Persistent
SetTimer, timer, -1
SetTimer, test, -500
Return

test()
{
   Timer:
   RegExMatch(&quot;var&quot;, &quot;(.)..&quot;, m)
   msgbox % m &quot;`n&quot; m1
   Return
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Fri, 30 Oct 2020 00:00:43 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=143003#p143003</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: WinHttp.WinHttpRequest.5.1]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=143002#p143002</link>
			<description><![CDATA[<p>Часть паттерна <em>.*</em> запинается на первом переносе строк, если он `r`n и не указана опция <em>s)</em>.<br /></p><div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>Добавлю для ясности, что метка таймера не является в данном случае частью функции, хотя она и визуально расположена внутри неё.</p></blockquote></div><p>Да, был не прав. Никогда не использую подобные конструкции. Можно упростить:<br /></p><div class="codebox"><pre><code>#Persistent
MyFunc()
Return

MyFunc() {
   static var := &quot;test&quot;
   SetTimer, Timer, -1000
   Return

   Timer:
      RegExMatch(var, &quot;(.)&quot;, m)
      MsgBox, % m1
      Return
}</code></pre></div><p>В то же время срабатывает, если объявить <em>m1</em> глобальной. Для меня такое поведение непонятно, я бы счёл багом.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Thu, 29 Oct 2020 21:57:40 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=143002#p143002</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: WinHttp.WinHttpRequest.5.1]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=143001#p143001</link>
			<description><![CDATA[<p>Я уже писал об этом баге документации.<br />Правильно так:<br />Точка без опции s, не может быть символом `r если после символа `r идет символ `n.</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Thu, 29 Oct 2020 21:55:31 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=143001#p143001</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: WinHttp.WinHttpRequest.5.1]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=143000#p143000</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>DotAll. This causes a period (.) to match all characters including newlines (normally, it does not match newlines). However, when the newline character is at its default of CRLF (`r`n), two dots are required to match it (not one). Regardless of this option, a negative class such as [^a] always matches newlines.</p></blockquote></div><p><strong>teadrinker</strong><br />Спасибо, но почему это имеет значение в этом шаблоне, разве (.*) не должно включать всё что угодно, одиночный или двойной, какая разница.<br /></p><div class="quotebox"><blockquote><p>However, when the newline character is at its default of CRLF (`r`n), two dots are required to match it (not one)</p></blockquote></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Thu, 29 Oct 2020 21:47:53 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=143000#p143000</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: WinHttp.WinHttpRequest.5.1]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=142999#p142999</link>
			<description><![CDATA[<div class="quotebox"><cite>serzh82saratov пишет:</cite><blockquote><p>А тут не знаешь в чём дело, у меня RegExReplace из строки скопированной из запроса и из самого запроса выдаёт разные результаты.</p></blockquote></div><p>Разные переносы строк, добавь опцию <em>s)</em>.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Thu, 29 Oct 2020 21:22:45 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=142999#p142999</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: WinHttp.WinHttpRequest.5.1]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=142998#p142998</link>
			<description><![CDATA[<div class="quotebox"><cite>teadrinker пишет:</cite><blockquote><p>метка таймера не является в данном случае частью функции</p></blockquote></div><p>А откуда в ней доступ к статическим переменным этой функции?</p>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Thu, 29 Oct 2020 21:18:17 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=142998#p142998</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: WinHttp.WinHttpRequest.5.1]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=142997#p142997</link>
			<description><![CDATA[<p><strong>Malcev</strong><br />Спасибо, вспомнил что очень давно с этим сталкивался.</p><p>А тут не знаешь в чём дело, у меня RegExReplace из строки скопированной из запроса и из самого запроса выдаёт разные результаты.<br /></p><div class="codebox"><pre><code>
responseText = 
(  
&lt;!DOCTYPE HTML&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
  &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
  &lt;title&gt;AutoHotkey Downloads&lt;/title&gt;
  &lt;script src=&quot;/cdn-cgi/apps/head/21XiSFXBdVHXl7A_izEkLSn9ayc.js&quot;&gt;&lt;/script&gt;&lt;link rel=&quot;icon&quot; type=&quot;image/ico&quot; href=&quot;/favicon.ico&quot;&gt;
  &lt;link rel=&quot;stylesheet&quot; href=&quot;css/style.css&quot;&gt;
  &lt;meta name=&quot;robots&quot; content=&quot;noindex,nofollow&quot;&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;a href=&quot;/&quot;&gt;&lt;img src=&quot;/static/ahk_logo.svg&quot;&gt;&lt;/a&gt;
&lt;p&gt;Current version: &lt;a href=&quot;../docs/AHKL_ChangeLog.htm&quot;&gt;&lt;!--update--&gt;v1.1.33.02 - July 17, 2020&lt;!--/update--&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a class=&quot;install_button&quot; href=&quot;ahk-install.exe&quot;&gt;Download AutoHotkey Installer&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Mirror: &lt;a href=&quot;https://github.com/Lexikos/AutoHotkey_L/releases&quot;&gt;Releases on GitHub&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;ahk.zip&quot;&gt;Download AutoHotkey .zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;https://github.com/Lexikos/AutoHotkey_L/&quot;&gt;Source code on GitHub&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; The installer also includes an &quot;extract to&quot; function to extract all files without installing. This can be accessed from the installer GUI or &lt;a href=&quot;/docs/Program.htm#install&quot;&gt;on the command line&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Other Releases&lt;/h2&gt;
&lt;p class=&quot;warning&quot;&gt;&lt;strong&gt;Note:&lt;/strong&gt; Google Safe Browsing sometimes falsely flags these directories as containing &quot;harmful programs&quot;. For more information, see &lt;a href=&quot;safe.htm&quot;&gt;Safe Browsing&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;1.1/&quot;&gt;AutoHotkey 1.1.*&lt;/a&gt; - previously known as AutoHotkey_L.&lt;br&gt;
&lt;a href=&quot;1.0/&quot;&gt;AutoHotkey 1.0.*&lt;/a&gt; - also retroactively known as AutoHotkey Basic, Classic, Vanilla, etc.&lt;br&gt;
&lt;a href=&quot;2.0/&quot;&gt;AutoHotkey 2.0-a*&lt;/a&gt; - see &lt;a href=&quot;/v2/&quot;&gt;AutoHotkey v2&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Documentation&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;/docs/AutoHotkey.htm&quot;&gt;Online - v1.1&lt;/a&gt;&lt;br&gt;
&lt;a href=&quot;https://lexikos.github.io/v2/docs/AutoHotkey.htm&quot;&gt;Online - v2.0-alpha&lt;/a&gt;&lt;/p&gt;
Help files in other languages - these are maintained by other volunteers, so are sometimes out of date:
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://ahkcn.sf.net/&quot;&gt;Chinese&lt;/a&gt; (ä¸æ)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/ahkde/docs/releases/latest&quot;&gt;German&lt;/a&gt; (Deutsch)&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/ahkscript/AHK-Docs_KO/releases/latest&quot;&gt;Korean&lt;/a&gt; (íêµì´)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;English documentation is included in the installer and portable downloads.&lt;/p&gt;

&lt;h2&gt;Uninstallation&lt;/h2&gt;
&lt;p&gt;If you are looking to uninstall AutoHotkey and you are having trouble doing so, please &lt;a href=&quot;/uninstall&quot;&gt;click here&lt;/a&gt; for detailed instructions (with pictures).&lt;/p&gt;

&lt;/body&gt;
&lt;/html&gt;


)
MsgBox % RegExReplace(responseText, &quot;.*?&lt;!--update--&gt;v(.*?) - .*&quot;, &quot;$1&quot;)


req := ComObjCreate(&quot;WinHttp.WinHttpRequest.5.1&quot;)
req.Option(6) := 0
req.open(&quot;GET&quot;, &quot;https://www.autohotkey.com/download/&quot;, 1)
req.send()
Sleep 2222 
MsgBox % RegExReplace(Clipboard := req.responseText, &quot;.*?&lt;!--update--&gt;v(.*?) - .*&quot;, &quot;$1&quot;)
Return
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Thu, 29 Oct 2020 21:17:00 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=142997#p142997</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: WinHttp.WinHttpRequest.5.1]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=142996#p142996</link>
			<description><![CDATA[<p>Добавлю для ясности, что метка таймера не является в данном случае частью функции, хотя она и визуально расположена внутри неё.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Thu, 29 Oct 2020 21:11:57 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=142996#p142996</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: WinHttp.WinHttpRequest.5.1]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=142995#p142995</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>Within a function (unless force-local mode is in effect), any dynamic variable reference such as Array%i% always resolves to a local variable unless no variable of that name exists, in which case a global is used if it exists. If neither exists and the usage requires the variable to be created, it is created as a local variable unless the assume-global mode is in effect. Consequently, a function can create a global array manually (by means such as Array%i% := A_Index) only if it has been defined as an assume-global function.</p></blockquote></div><p><a href="https://www.autohotkey.com/docs/Functions.htm#More_about_locals_and_globals">https://www.autohotkey.com/docs/Functio … nd_globals</a><br />Либо выводи таймер за пределы функции и передавай ему req.<br />Либо используй объект match.<br />Либо объявляй m1 как глобальную.</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Thu, 29 Oct 2020 20:42:31 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=142995#p142995</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: WinHttp.WinHttpRequest.5.1]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=142992#p142992</link>
			<description><![CDATA[<p>Не понимаю, почему RegEx не работает в метке по таймеру. Во втором MsgBox&nbsp; у меня пусто.<br /></p><div class="codebox"><pre><code>
req := ComObjCreate(&quot;WinHttp.WinHttpRequest.5.1&quot;)
req.Option(6) := 0
req.open(&quot;GET&quot;, &quot;https://www.autohotkey.com/download/&quot;, 1)
req.send()
Sleep 2222 

RegExMatch(req.responseText, &quot;&lt;!--update--&gt;v(.*?) - &quot;, m)
MsgBox % m1

CheckAhkNewVersion()
Return

CheckAhkNewVersion() {
	Static req, att := 0  
	req := ComObjCreate(&quot;WinHttp.WinHttpRequest.5.1&quot;)
	req.Option(6) := 0
	req.open(&quot;GET&quot;, &quot;https://www.autohotkey.com/download/&quot;, 1)
	req.send()
	SetTimer, lCheckAhkNewVersion, -1000
	Return

	lCheckAhkNewVersion:
		++att
		If (req.Status = 200)
		{
			RegExMatch(req.responseText, &quot;&lt;!--update--&gt;v(.*?) - &quot;, m)
			MsgBox % m1
			Return
		}
		If (att &lt;= 3)
			SetTimer, lCheckAhkNewVersion, -2000
		Return 
}
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (serzh82saratov)]]></author>
			<pubDate>Thu, 29 Oct 2020 19:32:26 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=142992#p142992</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: WinHttp.WinHttpRequest.5.1]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=128889#p128889</link>
			<description><![CDATA[<p><strong>lexavolksvl</strong>, а что вы игнорируете замечание модератора?<br />Так и до бана недалеко.</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Thu, 27 Sep 2018 21:02:28 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=128889#p128889</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: WinHttp.WinHttpRequest.5.1]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=128888#p128888</link>
			<description><![CDATA[<p>Уже вопрос решен. Всем спасибо кто пытался помочь. Но разобрался сам <img src="//forum.script-coding.com/img/smilies/big_smile.png" width="15" height="15" /></p>]]></description>
			<author><![CDATA[null@example.com (lexavolksvl)]]></author>
			<pubDate>Thu, 27 Sep 2018 19:10:32 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=128888#p128888</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: WinHttp.WinHttpRequest.5.1]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=128887#p128887</link>
			<description><![CDATA[<p><a href="https://sayakb.github.io/sticky-notes/pages/api/">Sticky Notes Api</a><br />А вообще-то и так работает:<br /></p><div class="codebox"><pre><code>baseUrl := &quot;https://paste.lemonmc.com/&quot;

http := ComObjCreate(&quot;WinHttp.WinHttpRequest.5.1&quot;)
http.Open(&quot;POST&quot;, baseUrl . &quot;api/json/create&quot;)
http.SetRequestHeader(&quot;Content-Type&quot;, &quot;application/json&quot;)
http.Send(&quot;{&quot;&quot;data&quot;&quot;:&quot;&quot;MsgBox, Hello, World!&quot;&quot;,&quot;&quot;language&quot;&quot;:&quot;&quot;autohotkey&quot;&quot;}&quot;)
MsgBox, % Clipboard := RegExReplace(http.responseText, &quot;s).*&quot;&quot;id&quot;&quot;:\s*&quot;&quot;(.+?)&quot;&quot;.*&quot;, baseUrl . &quot;$1&quot;)</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Thu, 27 Sep 2018 18:53:13 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=128887#p128887</guid>
		</item>
	</channel>
</rss>
