Re: Text File Comparison

new topic     » goto parent     » topic index » view thread      » older message » newer message

On Tue, 12 Feb 2002 23:22:45 -0300, you wrote:

>>I was going to ask you what max,min, and n were actually for and what
>>you were after with "minimum slack".
>Regarding the names of my variables, I did not take much care for them to be
>significative... :)
That's helpful.

After general success, I decided to 'cane' your code to see how stable
it is, so I compared the stamped, comment stripped version of win32lib
(285K) and the fulltext version (673K)

	while i <= lens do
		min = max
		topi = lens + 1
		m = i
		while m < topi do
			x = s[m] --Speedwise
--                                   ^^^ subscript out of bounds
			n = min - m + i + z - 1
			if n > lent then
				n = lent
			end if
			for j = z to n do --Search for minimum slack
				if equal(x, t[j]) then
					min = m - i + j - z --Update minimum slack
if min + i < topi then --<<<					
					topi = min + i --Update upper limit for m
end if --<<<
					a = m
					b = j
					exit
				end if
			end for
			m += 1
		end while

I've put the above to stop if bombing but as you won't explain what
the code is trying to do I don't know, for example, if I should not
update a & b at that point or reset min...

Pete

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu