Error Building Struct with CreateUUID
This is more for myself than anyone else, but I hit an odd snag in ColdFusion this morning. I got an error when trying to create a new structure member using a CreateUUID() function and ColdFusion's shorthand structure notation. The following code fails:7 Comments
Bradley Moore wrote on 03/26/09 2:39 PM
Best guess, it has something to do with how structs are created using the curly brackets. This works:Garrett Johnson wrote on 03/26/09 4:59 PM
strange! Must be an odd assignment thing... It likes this though...Garrett Johnson wrote on 03/26/09 5:11 PM
Appears to be a struct literal problem... not a uuid issue... http://www.barneyb.com/barneyblog/2008/07/14/coldfusion-struct-literals-fail-again/John Whish wrote on 03/27/09 3:59 AM
This is a wild stab in the dark, but I wouldv'e thought that it is something to do with the order that ColdFusion evaluates your code. I think that it is probably doing the "currentOrder.Cart" before it generates the CreateUUID() key name.Daniel Short wrote on 03/27/09 8:06 AM
Yep, I was reading his post yesterday as well. Looks like we're both hitting the same silly issue.Daniel Short wrote on 03/27/09 8:06 AM
Yep, my experience exactly.
Azadi Saryev wrote on 03/26/09 2:36 PM
i do not exactly know why, but: a) i think it has something to do with the way cf evaluates things with implicit array/structure notation; b) it is definitely related to http://www.bennadel.com/index.cfm?dax=blog:1545.view Azadi