Monday, September 1, 2003, 12:51:27 AM, you wrote:
M> Hi Ike and Adam (and others),

M> I tried Ike's suggestion below but with the same outcome.  

M>         <cfif session.basket.ProductURL EQ "">
M>                 <cfset URL = "">
M>         <cfelse>
M>                 <cfset URL =
M> URLEncodedFormat(session.basket.ProductURL)>
M>         </cfif>

url is a reserved word. Any attempts to change it are ignored, so the
above code is essentially ignored.
http://livedocs.macromedia.com/coldfusion/6/Developing_ColdFusion_MX_Applications_with_CFML/Elements15.htm

M>         <cfset thisStruct = URL> <!--- Did this just to keep the sample
simple  --->>
M>         <cfscript>
M>                 thisStructList = structKeyList(thisStruct);
M>                 thisString = "";
M>                 for(i = 1; i LTE listLen(thisStructList); i = i + 1)
M>                 {
M>                         thisString = listAppend(thisString,
M> evaluate(listGetAt(thisStructList, i))); 
M>                 }
M>         </cfscript>

This code, in and of itself will not error out. It will execute, just
not like you are expecting...I think. You attempt to set it to a
string in the first section, but then use structKeyList on it, so it's
hard to ascertain your goal here.

<snip>

M> <CFQUERY datasource="#dsn_orders#">
M> INSERT INTO
M>         tblInvoiceLineDetails 
M>         (
M>                 fldInvoiceID,
M>                 fldPartID,
M>                 fldPartNumber,
M>                 fldProductURL,
M>                 fldPrice,
M>                 fldQuantity,
M>                 fldGroupBuy,
M>                 fldGrouping
M>         )

M> VALUES
M>         (
M>                 #getLastInvoiceID.LastInvoice#,
M>                 #session.basket.PartID#,
M>                 '#session.basket.PartNumber#',
M>                 '#URL#',

This will cause the exact error you are seeing, since URL is not a
string. Changing the variable name URL to something else in your code
should fix the problem.

M>                 #PriceForQuery#,
M>                 #session.basket.Quantity#,
M>                 #session.basket.GroupBuy#,
M>                 #session.basket.Grouping#
                
M>         )
M>                 </CFQUERY>

M> And as show at the top of this email, it stops with an erro when trying
M> to use the URL or thisStructList variables.

M> Does anybody else have any ideas?  

Sure... :) CF should throw an error at compile time when a reserved
word is attempted to be set. That's sort of standard...don't know
why CF doesn't do it in the first place.

M> Cheers
M> 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

Get the mailserver that powers this list at 
http://www.coolfusion.com

Reply via email to