> I have a file that is creating a CF template using the following code: > > <cfloop Query="languages"> > <cffile > action = "write" > *file = > "#ExpandPath('/contentFiles/#maxContentID#_#language#.cfm')#" * > output = "#Evaluate( "#language#TEXT" )#" > nameconflict="overwrite"> > </cfloop> > > It used to work fine but all of a sudden the red line is causing the > following error: > > *Complex object types cannot be converted to simple values. > The expression has requested a variable or an intermediate expression result > as a simple value. However, the result cannot be converted to a simple > value. Simple values are strings, numbers, boolean values, and date/time > values. Queries, arrays, and COM objects are examples of complex values. > > The most likely cause of the error is that you tried to use a complex value > as a simple one. For example, you tried to use a query variable in a cfif > tag. * > > Any suggestions?
First, I'd suggest that you not use nested hashes. Instead of this: "#ExpandPath('/contentFiles/#maxContentID#_#language#.cfm')#" use this: "#ExpandPath('/contentFiles/' & maxContentID & '_' & language & '.cfm')#" However, I don't think that's the cause of your problem. Instead, I suspect that one of your variables contains something other than what you think it does. Use CFDUMP to see what's in those variables. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ http://training.figleaf.com/ Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on GSA Schedule, and provides the highest caliber vendor-authorized instruction at our tr ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339062 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm