Compare data within 2 CFCs
Is there an easy way to compare the data within 2 CFCs? For example these 2 CFC instances contain different data: CFC1=createObject('Customer').Read(ID=10) CFC2=createObject('Customer').Read(ID=99) Baz ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233871 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Compare data within 2 CFCs
You would need a function that would return the ID. cffunction getID() cfreturn variables.id /cffunction Then you do a compare outside of the cfcs. Bob ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233880 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Compare data within 2 CFCs
From: Baz [mailto:[EMAIL PROTECTED] Is there an easy way to compare the data within 2 CFCs? For example these 2 CFC instances contain different data: CFC1=createObject('Customer').Read(ID=10) CFC2=createObject('Customer').Read(ID=99) Provide a method in the Customer CFC that returns the instance data (getInstance()). Then use this UDF to see the differences: http://www.cflib.org/udf.cfm?ID=1136 Tango. ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233883 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Compare data within 2 CFCs
Thanks Bob but that wouldn't work in this case: CFC1=createObject('Customer').Read(ID=10) CFC2=duplicate(CFC1) CFC2.setName('kakapipi') I was thinking of perhaps some hash type function that would convert each CFC into some 64-bit string that you could compare. Perhaps invoked like this: isDuplicateCFC(CFC1,CFC2) Baz -Original Message- From: Robert Everland III [mailto:[EMAIL PROTECTED] Sent: Thursday, March 02, 2006 8:37 AM To: CF-Talk Subject: Re: Compare data within 2 CFCs You would need a function that would return the ID. cffunction getID() cfreturn variables.id /cffunction Then you do a compare outside of the cfcs. Bob ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233886 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: Compare data within 2 CFCs
That's a decent suggestion too Tango, but some of the CFCs I want to compare have other CFCs in them. So I could return one mother of a struct that contains other structs for each internal CFC, but that's the part I'm trying to avoid. One advantage is that I actually don't need to know what the differences are, just that there are differences. Baz -Original Message- From: Michael T. Tangorre [mailto:[EMAIL PROTECTED] Sent: Thursday, March 02, 2006 9:41 AM To: CF-Talk Subject: RE: Compare data within 2 CFCs From: Baz [mailto:[EMAIL PROTECTED] Is there an easy way to compare the data within 2 CFCs? For example these 2 CFC instances contain different data: CFC1=createObject('Customer').Read(ID=10) CFC2=createObject('Customer').Read(ID=99) Provide a method in the Customer CFC that returns the instance data (getInstance()). Then use this UDF to see the differences: http://www.cflib.org/udf.cfm?ID=1136 Tango. ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:233889 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54