<?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=11167&amp;type=atom" />
	<updated>2015-12-22T21:01:21Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=11167</id>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Посимвольное сравнение файлов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=99877#p99877" />
			<content type="html"><![CDATA[<p>Спасибо, работает.</p>]]></content>
			<author>
				<name><![CDATA[Tsubasa]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26524</uri>
			</author>
			<updated>2015-12-22T21:01:21Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=99877#p99877</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Посимвольное сравнение файлов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=99874#p99874" />
			<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>2015-12-22T20:27:55Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=99874#p99874</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Посимвольное сравнение файлов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=99873#p99873" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>file1 := RegExReplace(FileOpen(&quot;file1.txt&quot;,&quot;r&quot;).Read() ,&quot;\s&quot;)
file2 := RegExReplace(FileOpen(&quot;file2.txt&quot;,&quot;r&quot;).Read() ,&quot;\s&quot;)

var1 := StrSplit(file1)
var2 := StrSplit(file2)
var3 := []
loop % var1.MaxIndex()
 var3 .= (var1[A_Index] = var2[A_Index]) and (var1[A_Index] = 1)

msgbox % var3
</code></pre></div>]]></content>
			<author>
				<name><![CDATA[yalanne]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32850</uri>
			</author>
			<updated>2015-12-22T20:21:39Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=99873#p99873</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Посимвольное сравнение файлов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=99870#p99870" />
			<content type="html"><![CDATA[<p>Мой косяк. Там лимит символов ahk не позволяет, сейчас по другому сделаю.</p>]]></content>
			<author>
				<name><![CDATA[yalanne]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32850</uri>
			</author>
			<updated>2015-12-22T18:46:39Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=99870#p99870</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Посимвольное сравнение файлов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=99869#p99869" />
			<content type="html"><![CDATA[<p>Да, два файла. В каждом по 11 строк, каждая символов по 90. И там точно есть пересечения.</p>]]></content>
			<author>
				<name><![CDATA[Tsubasa]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26524</uri>
			</author>
			<updated>2015-12-22T18:42:58Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=99869#p99869</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Посимвольное сравнение файлов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=99867#p99867" />
			<content type="html"><![CDATA[<p>То есть нули, весь ответ в нулях? вы два файла создали и заполонили их?<br /><a href="https://www.youtube.com/watch?v=eyQT-er4pGU&amp;feature=youtu.be">Запись экрана.</a><br /><a href="https://www.autohotkey.com/docs/commands/Format.htm">Format()</a><br /><a href="https://autohotkey.com/docs/commands/FileOpen.htm">FileOpen()</a></p>]]></content>
			<author>
				<name><![CDATA[yalanne]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32850</uri>
			</author>
			<updated>2015-12-22T18:19:55Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=99867#p99867</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Посимвольное сравнение файлов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=99866#p99866" />
			<content type="html"><![CDATA[<p>Да, так работает (правда выдаёт нули, но с этим разберусь). А где-нибудь есть документация на такие функции (можно и на английском). Когда гуглил, не нашёл их.</p>]]></content>
			<author>
				<name><![CDATA[Tsubasa]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26524</uri>
			</author>
			<updated>2015-12-22T18:17:10Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=99866#p99866</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Посимвольное сравнение файлов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=99863#p99863" />
			<content type="html"><![CDATA[<p>Версия ahk старая. <a href="http://ahkscript.org/">Обнови вот ссылка.</a></p>]]></content>
			<author>
				<name><![CDATA[yalanne]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32850</uri>
			</author>
			<updated>2015-12-22T18:11:17Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=99863#p99863</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Посимвольное сравнение файлов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=99862#p99862" />
			<content type="html"><![CDATA[<p>Сам скрипт выдаёт <em>Error:&nbsp; Call to nonexistent function.</em> и я не понимаю, что тут вообще происходит, но попробую разобраться. Спасибо.</p>]]></content>
			<author>
				<name><![CDATA[Tsubasa]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26524</uri>
			</author>
			<updated>2015-12-22T18:08:15Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=99862#p99862</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Посимвольное сравнение файлов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=99860#p99860" />
			<content type="html"><![CDATA[<p>Держи:<br /></p><div class="codebox"><pre><code>file1 := FileOpen(&quot;file1.txt&quot;,&quot;r&quot;).Read()
file2 := FileOpen(&quot;file2.txt&quot;,&quot;r&quot;).Read()
var := format(&quot;{1:+0&quot; StrLen(file1) &quot;}&quot;, format(&quot;{:x}&quot;,format(&quot;0x{}&quot;,file1) &amp; format(&quot;0x{}&quot;,file2)))

msgbox % var</code></pre></div>]]></content>
			<author>
				<name><![CDATA[yalanne]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32850</uri>
			</author>
			<updated>2015-12-22T17:48:44Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=99860#p99860</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Посимвольное сравнение файлов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=99859#p99859" />
			<content type="html"><![CDATA[<p>Ох, извините, забыл. Исправил.</p>]]></content>
			<author>
				<name><![CDATA[Tsubasa]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26524</uri>
			</author>
			<updated>2015-12-22T17:47:14Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=99859#p99859</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: AHK: Посимвольное сравнение файлов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=99858#p99858" />
			<content type="html"><![CDATA[<p>В имени темы нет префикса &quot;AHK: &quot; Это ошибка. Напишешь тебе ответят.</p>]]></content>
			<author>
				<name><![CDATA[yalanne]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=32850</uri>
			</author>
			<updated>2015-12-22T17:18:57Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=99858#p99858</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[AHK: Посимвольное сравнение файлов]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=99857#p99857" />
			<content type="html"><![CDATA[<p>Добрый день!<br />Мне нужно сравнить посимвольно два файла и записать результат в третий. Файлы одинакового размера и содержат только нули и единицы, а результат должен быть логическим И этих символов.<br />То есть:<br />Файл 1:000100101110001<br />Файл 2:010100010101111<br />резулт:000100000100001</p><p>Я читал справку по операторам, пробовал и так и эдак. Единственный вариант, который сейчас вижу - это вот такой алгоритм:<br />-Посимвольно перебираем первый файл в Loop.<br />-Сравниваем символы с &quot;1&quot;, ваписывая в третий 0, если 0. Как только находим &quot;1&quot;, вычисляем положение символа.<br />-Перебираем в Loop второй файл до этого места, считываем символ, проверяем, 0 или 1, и если 1, то пишем в третий файл &quot;1&quot;, иначе &quot;0&quot;.</p><p>Какой-то велосипед получился. Нет ли более красивого решения?</p>]]></content>
			<author>
				<name><![CDATA[Tsubasa]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=26524</uri>
			</author>
			<updated>2015-12-22T16:32:35Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=99857#p99857</id>
		</entry>
</feed>
