<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Перевод из string в integer]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=10503</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=10503&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Перевод из string в integer».]]></description>
		<lastBuildDate>Thu, 19 Mar 2015 10:28:05 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Перевод из string в integer]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92628#p92628</link>
			<description><![CDATA[<div class="quotebox"><cite>wisgest пишет:</cite><blockquote><p>Если кто не заметил, в документации есть такой пример:<br /><a href="http://ahkscript.org/docs/commands/Run.htm#ExecScript">http://ahkscript.org/docs/commands/Run.htm#ExecScript</a>.<br />Я бы в нём исправил строку<br /></p><div class="codebox"><pre><code>    exec := shell.Exec(&quot;AutoHotkey.exe /ErrorStdOut *&quot;)</code></pre></div><p>на<br /></p><div class="codebox"><pre><code>    exec := shell.Exec(A_AhkPath . &quot; /ErrorStdOut *&quot;)</code></pre></div></blockquote></div><p>Спасибо, вроде как мне подходит.</p>]]></description>
			<author><![CDATA[null@example.com (yalanne)]]></author>
			<pubDate>Thu, 19 Mar 2015 10:28:05 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92628#p92628</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Перевод из string в integer]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92614#p92614</link>
			<description><![CDATA[<div class="quotebox"><cite>wisgest пишет:</cite><blockquote><p>Если кто не заметил, в документации есть такой пример</p></blockquote></div><p> Заметили, но это запуск кода отдельным процессом, в отличие от предыдущего примера.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Wed, 18 Mar 2015 23:30:54 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92614#p92614</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Перевод из string в integer]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92608#p92608</link>
			<description><![CDATA[<p>Если кто не заметил, в документации есть такой пример:<br /><a href="http://ahkscript.org/docs/commands/Run.htm#ExecScript">http://ahkscript.org/docs/commands/Run.htm#ExecScript</a>.<br />Я бы в нём исправил строку<br /></p><div class="codebox"><pre><code>    exec := shell.Exec(&quot;AutoHotkey.exe /ErrorStdOut *&quot;)</code></pre></div><p>на<br /></p><div class="codebox"><pre><code>    exec := shell.Exec(A_AhkPath . &quot; /ErrorStdOut *&quot;)</code></pre></div><p>хотя не знаю, как быть с откомпилированными скриптами, если нет отдельного AutoHotkey.exe.<br />----------------------------------------<br /></p><div class="quotebox"><cite>Irbis пишет:</cite><blockquote><p>Файл JS.wsc создан?<br />Вот бы обойтись без промежуточного файла...</p></blockquote></div><p>У меня работает через формат MHTML:<br /></p><div class="codebox"><pre><code> /*
MIME-Version: 1.0
Content-Type:multipart/related; boundary=&quot;BOUNDARY&quot;;


--BOUNDARY
Content-Type: text/scriptlet; charset=&quot;windows-1251&quot;
Content-Transfer-Encoding: 8bit
Content-Location: JS.wsc

&lt;component&gt;
&lt;public&gt;&lt;method name=&#039;eval&#039;/&gt;&lt;/public&gt;
&lt;script language=&#039;JScript&#039;&gt;&lt;/script&gt;
&lt;/component&gt;


--BOUNDARY--

*/
ScriptletURL := &quot;mhtml:&quot; . A_ScriptFullPath . &quot;!JS.wsc&quot;
JS := ComObjGet(&quot;script:&quot; . ScriptletURL)

MsgBox % JS.eval(&quot;1 + 1 * 2&quot;)
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (wisgest)]]></author>
			<pubDate>Wed, 18 Mar 2015 22:03:58 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92608#p92608</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Перевод из string в integer]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92599#p92599</link>
			<description><![CDATA[<p>Непонятно, но работает.<br /></p><div class="codebox"><pre><code>/*&lt;component&gt;
&lt;public&gt;&lt;method name=&#039;eval&#039;/&gt;&lt;/public&gt;
&lt;script language=&#039;JScript&#039;&gt;&lt;/script&gt;
&lt;/component&gt;
*/ JS := ComObjGet(&quot;script:&quot; . A_ScriptFullPath)
loop 4 {
   q := A_Index &quot;*&quot; A_Index &quot;-&quot; 1
   MsgBox % q &quot; = &quot; JS.eval(q)
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Irbis)]]></author>
			<pubDate>Wed, 18 Mar 2015 18:17:10 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92599#p92599</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Перевод из string в integer]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92597#p92597</link>
			<description><![CDATA[<p>Файл JS.wsc создан?<br />Вот бы обойтись без промежуточного файла...<br /></p><div class="codebox"><pre><code>ScriptletURL := A_ScriptDir . &quot;\JS.wsc&quot;
if !FileExist(ScriptletURL)
FileAppend,
(
&lt;component&gt;
&lt;public&gt;&lt;method name=&#039;eval&#039;/&gt;&lt;/public&gt;
&lt;script language=&#039;JScript&#039;&gt;&lt;/script&gt;
&lt;/component&gt;
), %ScriptletURL%
JS := ComObjGet(&quot;script:&quot; . ScriptletURL)

MsgBox % JS.eval(&quot;1 + 1 * 2&quot;)
</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Irbis)]]></author>
			<pubDate>Wed, 18 Mar 2015 17:00:59 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92597#p92597</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Перевод из string в integer]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92596#p92596</link>
			<description><![CDATA[<p><a href="http://forum.script-coding.com/viewtopic.php?id=9101">Этот</a> вариант тоже выдает ошибку: 0х800С0005 - Не удается найти указанный ресурс.<br />если что у меня Windows 10 Technical Preview может из за этого не работает.</p>]]></description>
			<author><![CDATA[null@example.com (yalanne)]]></author>
			<pubDate>Wed, 18 Mar 2015 16:47:20 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92596#p92596</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Перевод из string в integer]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92594#p92594</link>
			<description><![CDATA[<p>Нет, я имел в виду объект с возможностью использовать другой скриптовый язык с функцией Eval(), например <a href="http://forum.script-coding.com/viewtopic.php?id=9101">этот</a> вариант.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Wed, 18 Mar 2015 16:19:38 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92594#p92594</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Перевод из string в integer]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92593#p92593</link>
			<description><![CDATA[<p>Я вот такой вариант сделал:<br /></p><div class="codebox"><pre><code>q := &quot;5+5-2&quot;

w_calc:
if ((((wexp:=&quot;&quot;) (w1:=&quot;&quot;) (w2:=&quot;&quot;) (wloop:=0)) ? &quot;&quot; : &quot;&quot;) ((((wexp := RegExMatch(q, &quot;[\+|\-|\*|\/]&quot;,&quot;&quot;,(RegExMatch(q, &quot;[\+|\-|\*|\/]&quot;,&quot;&quot;) + 1))) ? ((wloop:=1) (wexp:=substr(q,1,wexp-1))) : (wexp:=q)) ? &quot;&quot; :)) (((RegExMatch(wexp, &quot;(.*)[\+|\-|\*|\/]&quot;,w1) ? &quot;&quot; : &quot;&quot; ) (RegExMatch(wexp, &quot;[\+|\-|\*|\/]&quot;,w) ? &quot;&quot; : &quot;&quot; ) (RegExMatch(wexp, &quot;[\+|\-|\*|\/](.*)&quot;,w2)) (w1:=substr(w1,1,-1)) (w2:=substr(w2,2,strlen(w2)-1))) ? &quot;&quot; : &quot;&quot;) ((q:=(((w=&quot;+&quot;) ? w1 + w2 : (w=&quot;-&quot;) ? w1 - w2 : (w=&quot;*&quot;) ? w1 * w2 : w1 // w2) substr(q,strlen(wexp)+1,strlen(q)-strlen(wexp)+1))) ? &quot;&quot; : &quot;&quot;)) wloop
goto w_calc

msgbox % q</code></pre></div><p>минус его только то в том, что игнорируется математические правила, то есть высчитывает все по порядку.<br />например </p><div class="codebox"><pre><code>1+1*2</code></pre></div><p> будет как 1) 1+1=2 2)2*2=4</p>]]></description>
			<author><![CDATA[null@example.com (yalanne)]]></author>
			<pubDate>Wed, 18 Mar 2015 15:49:01 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92593#p92593</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Перевод из string в integer]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92592#p92592</link>
			<description><![CDATA[<p>Объект ScriptControl существует только в 32-битной версии. На форуме уже обсуждались другие варианты.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Wed, 18 Mar 2015 15:13:33 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92592#p92592</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Перевод из string в integer]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92591#p92591</link>
			<description><![CDATA[<p><strong>yalanne</strong>, дело в версии Autohotkey. На 32-разрядной версии скрипт работает под Win7 x64.</p>]]></description>
			<author><![CDATA[null@example.com (Irbis)]]></author>
			<pubDate>Wed, 18 Mar 2015 14:34:08 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92591#p92591</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Перевод из string в integer]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92589#p92589</link>
			<description><![CDATA[<p><strong>teadrinker</strong>, Исправил.<br /><strong>Irbis</strong>, Погуглив я понял что эта ошибка из за того что у меня стоит 64x бит windows.</p>]]></description>
			<author><![CDATA[null@example.com (yalanne)]]></author>
			<pubDate>Wed, 18 Mar 2015 14:12:46 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92589#p92589</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Перевод из string в integer]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92588#p92588</link>
			<description><![CDATA[<p>Посты очень желательно начинать с большой буквы, как и предложения.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Wed, 18 Mar 2015 13:21:13 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92588#p92588</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Перевод из string в integer]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92587#p92587</link>
			<description><![CDATA[<p>Собственно, замечание было относительно оформления темы, если не ошибаюсь. Если взглянуть на хронологию постов, сначала ТС исправился, затем стали отписываться участники. В чем я неправ?</p>]]></description>
			<author><![CDATA[null@example.com (Irbis)]]></author>
			<pubDate>Wed, 18 Mar 2015 13:15:57 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92587#p92587</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Перевод из string в integer]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92585#p92585</link>
			<description><![CDATA[<p><span style="color: green">Господа, на будущее, сначала выполнение требований модератора, затем помощь. В следующий раз буду удалять сообщения без предупреждений.</span></p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Wed, 18 Mar 2015 13:01:04 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92585#p92585</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Перевод из string в integer]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=92578#p92578</link>
			<description><![CDATA[<p>Сравни приведенный мной пример со своим сообщением и найди отличия.</p>]]></description>
			<author><![CDATA[null@example.com (Irbis)]]></author>
			<pubDate>Wed, 18 Mar 2015 10:56:25 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=92578#p92578</guid>
		</item>
	</channel>
</rss>
