I have code like the below, that basicaly create a list (this.List) with each entry composed of name,assetList,eventList and actionsList - each with their own types (they are objects in their own right). As you can see, the only difference betwen the two entrys on the list are the name, and the details of the eventList. But if I inspect this.List (with cfdump or elsewhere in the code) both entries in the list have the same eventList object !
I suspect this is a passing by reference, not value problem - does anyone know which CF does, and anytricks to make it do one or the other as you can't duplicate() objects (http://livedocs.macromedia.com/coldfusion/6/CFML_Reference/functions-pt174.htm#1104156) ? Do I really need to loop over the arguments scope by hand and duplicate() each entry ? this.List=createObject('component','com.bluefinger.events.userEventList'); assetList=createObject('component','com.bluefinger.assetList'); assetList.setTypes('gbb'); assetList.add('vehicle',3581); assetList.add('fleet',5); actionsList=createObject('component','com.bluefinger.events.actionsList'); tempT=createObject('component','com.bluefinger.events.action'); tempT.init('system','message','popup',3245); actionsList.add(tempT); tempT=createObject('component','com.bluefinger.events.action'); tempT.init('system','message','sms',3245); actionsList.add(tempT); eventList=createObject('component','com.bluefinger.events.typesList'); tmpT=this.availTypes.get('zoneManager'); tmpT.set('zone',8,'=',1); eventList.add(tmpT); this.List.add('my first userEvent',assetList,eventList,actionsList); eventList=createObject('component','com.bluefinger.events.typesList'); tmpT=this.availTypes.get('zoneManager'); tmpT.set('zone',2,'!=',1); eventList.add(tmpT); this.List.add('my second userEvent',assetList,eventList,actionsList); -- Tom Chiverton Advanced ColdFusion Programmer Tel: +44(0)1749 834997 email: [EMAIL PROTECTED] BlueFinger Limited Underwood Business Park Wookey Hole Road, WELLS. BA5 1AF Tel: +44 (0)1749 834900 Fax: +44 (0)1749 834901 web: www.bluefinger.com Company Reg No: 4209395 Registered Office: 2 Temple Back East, Temple Quay, BRISTOL. BS1 6EG. *** This E-mail contains confidential information for the addressee only. If you are not the intended recipient, please notify us immediately. You should not use, disclose, distribute or copy this communication if received in error. No binding contract will result from this e-mail until such time as a written document is signed on behalf of the company. BlueFinger Limited cannot accept responsibility for the completeness or accuracy of this message as it has been transmitted over public networks.*** ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]
