?? will this work ?? thisStructList = structKeyList(thisStruct); thisString = ""; for(i = 1; i LTE listLen(thisStructList); i = i + 1) { thisString = listAppend(thisString, evaluate(listGetAt(thisStructList, i))); }
If the struct is only one level deep this should do the trick in converting it to a list. If it's multiple levels you can throw this in a function and do some recursion. The original struct being 'thisStruct' and the converted variable being 'thisString'. Adam Wayne Lehman Web Systems Developer Johns Hopkins Bloomberg School of Public Health Distance Education Division -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, August 29, 2003 11:55 AM To: CF-Talk Subject: Re: Convert Complex data to string error. Hey mark, Show us the code where you're storing the variable and then again where you're trying to use / display the variable later where you're getting the error. There's probably a way to prevent it becoming a complex data type by altering the syntax where it's stored, but I need to see the syntax to test it over here. Thanks, Ike ------ Original Message ------ From: Mark Picker <[EMAIL PROTECTED]> To: CF-Talk <[EMAIL PROTECTED]> Sent: Aug 30, 2003 12:44 AM Subject: Re: Convert Complex data to string error. >Hi, > >I have some code that use to work fine under CF5. However since upgrading >one server to MX I keep getting the following error when trying to use one >particular variable: > > Complex object types cannot be converted to simple values. > >The variable holds some details about the URL that a product was selected >from. An example of the content is : > >cat=26&grouping=1&grouptitle=Products&PartID=151&page=1&title=Cooling%2 0Syst >em&do=action > >I have discovered that MX treats this code as a structure. However I can't >seem to find an easy way to convert this back to a string so that it can be >inserted into a database field (as a string). > >I found some details in the MX manual about using the cfml2wddx function to >convert to a string, but this brings back the text with the XML tags in it. > >My other problem is that whatever function I use, the code needs to work in >both CF5 and MX > >Does anybody have a simple method to convert this to a string type? > >Cheers >Mark > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/lists.cfm?link=t:4 Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. http://www.cfhosting.com