>Can I do a structure in a structure? For example, I have a "Customer" that >can contain a "Company" and one for more buying and billing people: > >Module defCustomer.cfm: ><cfscript> > attributes.Customer.Key=0; > attributes.Customer.IsCompany = False; > attributes.Customer.IsDeleted = False; > attributes.Customer.PeachtreeKey = ""; > attributes.Customer.BuyingPeople = ArrayNew(1); > attributes.Customer.BillingPeople = ArrayNew(1); > Company = StructNew(); ></cfscript> > ><cfmodule template="defcompany.cfm" Customer="#Company#"> ><cfset attributes.Customer.Company = StructCopy(Company)> > >defCompany.cfm: > ><cfscript> > attributes.Company.Key=0; > attributes.Company.Name = ""; > attributes.Company.Type = ""; > attributes.Company.IsDeleted = False; ></cfscript> > >If I CFDump attributes at the end of defCustomer, Customer.Company shows >empty; I don't see the defined structure. >
I really don't understand the the logic here. What value are you passing to the module defCompany module? If you are trying to pass the Company structure to the module then you should define the company structure first. If you are trying to expose the variable created in the module to the calling template then your module should do something like this: caller.Customer = StructCopy(attributes.Customer). Your code really confuses me here: ><cfmodule template="defcompany.cfm" Customer="#Company#"> ><cfset attributes.Customer.Company = StructCopy(Company)> However if I understand your objective: ><Can I do a structure in a structure? For example, I have a "Customer" that ><can contain a "Company" and one for more buying and billing people: Then something like this. <cfoutput> <cfscript> attributes.Customer.Key=0; attributes.Customer.IsCompany = False; attributes.Customer.IsDeleted = False; attributes.Customer.PeachtreeKey = ""; attributes.Customer.BuyingPeople = ArrayNew(1); attributes.Customer.BillingPeople = ArrayNew(1); attributes.Customer.Company = StructNew(); attributes.Customer.Company.key = 0; attributes.Customer.Company.Name = ""; attributes.Customer.Company.Type = ""; attributes.Customer.Company.IsDeleted = False; </cfscript> <cfdump var="#attributes#"> </cfoutput> Dwayne Cole, MS in MIS, MBA Florida A&M University Certified Advanced ColdFusion Developer 850-591-0212 "It can truely be said that nothing happens until there is vision. But it is equally true that a vision with no underlying sense of purpose, no calling, is just a good idea - all "sound and fury, signifiying nothing." The Fifth Discipline - Peter Senge ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4