<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Перевод из string в integer]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=10503&amp;type=atom" />
	<updated>2015-03-19T10:28:05Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=10503</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Перевод из string в integer]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=92628#p92628" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[yalanne]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32850</uri>
			</author>
			<updated>2015-03-19T10:28:05Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=92628#p92628</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Перевод из string в integer]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=92614#p92614" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>wisgest пишет:</cite><blockquote><p>Если кто не заметил, в документации есть такой пример</p></blockquote></div><p> Заметили, но это запуск кода отдельным процессом, в отличие от предыдущего примера.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2015-03-18T23:30:54Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=92614#p92614</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Перевод из string в integer]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=92608#p92608" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[wisgest]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=3850</uri>
			</author>
			<updated>2015-03-18T22:03:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=92608#p92608</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Перевод из string в integer]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=92599#p92599" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Irbis]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27384</uri>
			</author>
			<updated>2015-03-18T18:17:10Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=92599#p92599</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Перевод из string в integer]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=92597#p92597" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Irbis]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27384</uri>
			</author>
			<updated>2015-03-18T17:00:59Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=92597#p92597</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Перевод из string в integer]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=92596#p92596" />
			<content type="html"><![CDATA[<p><a href="http://forum.script-coding.com/viewtopic.php?id=9101">Этот</a> вариант тоже выдает ошибку: 0х800С0005 - Не удается найти указанный ресурс.<br />если что у меня Windows 10 Technical Preview может из за этого не работает.</p>]]></content>
			<author>
				<name><![CDATA[yalanne]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32850</uri>
			</author>
			<updated>2015-03-18T16:47:20Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=92596#p92596</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Перевод из string в integer]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=92594#p92594" />
			<content type="html"><![CDATA[<p>Нет, я имел в виду объект с возможностью использовать другой скриптовый язык с функцией Eval(), например <a href="http://forum.script-coding.com/viewtopic.php?id=9101">этот</a> вариант.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2015-03-18T16:19:38Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=92594#p92594</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Перевод из string в integer]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=92593#p92593" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[yalanne]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32850</uri>
			</author>
			<updated>2015-03-18T15:49:01Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=92593#p92593</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Перевод из string в integer]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=92592#p92592" />
			<content type="html"><![CDATA[<p>Объект ScriptControl существует только в 32-битной версии. На форуме уже обсуждались другие варианты.</p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2015-03-18T15:13:33Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=92592#p92592</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Перевод из string в integer]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=92591#p92591" />
			<content type="html"><![CDATA[<p><strong>yalanne</strong>, дело в версии Autohotkey. На 32-разрядной версии скрипт работает под Win7 x64.</p>]]></content>
			<author>
				<name><![CDATA[Irbis]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27384</uri>
			</author>
			<updated>2015-03-18T14:34:08Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=92591#p92591</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Перевод из string в integer]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=92589#p92589" />
			<content type="html"><![CDATA[<p><strong>teadrinker</strong>, Исправил.<br /><strong>Irbis</strong>, Погуглив я понял что эта ошибка из за того что у меня стоит 64x бит windows.</p>]]></content>
			<author>
				<name><![CDATA[yalanne]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32850</uri>
			</author>
			<updated>2015-03-18T14:12:46Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=92589#p92589</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Перевод из string в integer]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=92588#p92588" />
			<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>2015-03-18T13:21:13Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=92588#p92588</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Перевод из string в integer]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=92587#p92587" />
			<content type="html"><![CDATA[<p>Собственно, замечание было относительно оформления темы, если не ошибаюсь. Если взглянуть на хронологию постов, сначала ТС исправился, затем стали отписываться участники. В чем я неправ?</p>]]></content>
			<author>
				<name><![CDATA[Irbis]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27384</uri>
			</author>
			<updated>2015-03-18T13:15:57Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=92587#p92587</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Перевод из string в integer]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=92585#p92585" />
			<content type="html"><![CDATA[<p><span style="color: green">Господа, на будущее, сначала выполнение требований модератора, затем помощь. В следующий раз буду удалять сообщения без предупреждений.</span></p>]]></content>
			<author>
				<name><![CDATA[teadrinker]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=24515</uri>
			</author>
			<updated>2015-03-18T13:01:04Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=92585#p92585</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Перевод из string в integer]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=92578#p92578" />
			<content type="html"><![CDATA[<p>Сравни приведенный мной пример со своим сообщением и найди отличия.</p>]]></content>
			<author>
				<name><![CDATA[Irbis]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=27384</uri>
			</author>
			<updated>2015-03-18T10:56:25Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=92578#p92578</id>
		</entry>
</feed>
