Unfortunately nobody has defined a suitable = for Form.
It inherits from Object and Object treats = like ==
so form1 = form1 copy ---> false!
If there were an =, I would want it to check
height width and depth for equality before checking the bits.
Usually things won't match and that would save a lot of time.
Then I would like some good way to hash the bits into a useful static number. Do that once each time the bits change. Hold on to it and compare the hashes before comparing the bits.
Your way is not bad if you include the other h w and d .
Oh and you have to make sure that both forms are in an equal state of hibernation.
The fact that = doesn't work probably means no one actually compares forms directly.
Assuming you have two forms equal in h d and w
you could combine them using a subtracting rule. I think there is a quick check for allWhite. I don't know if it works other than at depth one.
Maybe someone else will have come accross this problem for real.
> From: Sean P. DeNigris <[hidden email]>
> Subject: [Newbies] Comparing two forms
> To: [hidden email] > Date: Friday, April 30, 2010, 11:53 PM
> How do you compare two forms to see if they are the same
> I did: form1 bits should equal: form2 bits. Is there
> a better way?