MD5 digest of arrays and controls
tsj at unimelb.edu.au
Mon Aug 1 18:20:04 CDT 2011
On 02/08/2011, at 03:57 AM, Alejandro Tejada wrote:
Terry Judd wrote:
How could I get the MD5digest of an Array and
all the properties of a control?
I guess you could use arrayEncode() first and then get an MD5digest of the
This command works great.
Many Thanks! :-D
Terry Judd wrote:
For example, I created a control, by script,
and I want to make sure that it's identical
to another control created by a different script.
How about copying the objects to the clipboard and then querying the
I am not sure how I could use this code
to compare the properties of two controls.
How about comparing the properties arrays of the two controls
In the following example I simply created two identical buttons on a blank stack. They should be identical in almost every respect, the exceptions being their ids their rects and their layers. If you put the properties array of each object into separate variables and delete the elements for those three properties from each variable then the two variables should be equivalent.
put the properties of btn 1 into t1
put the properties of btn 2 into t2
delete variable t1["id"]
delete variable t2["id"]
delete variable t1["rect"]
delete variable t2["rect"]
delete variable t1["layer"]
delete variable t2["layer"]
put t1 = t2
Alternatively, you could simply iterate through the keys of the properties of the two objects and compare the values of the individual properties.
Thanks again for your help!
View this message in context: http://runtime-revolution.278305.n4.nabble.com/MD5-digest-of-arrays-and-controls-tp3708824p3710396.html
Sent from the Revolution - User mailing list archive at Nabble.com<http://Nabble.com>.
use-livecode mailing list
use-livecode at lists.runrev.com<mailto:use-livecode at lists.runrev.com>
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the use-livecode