# within a #
|
|
Thread rating:  |
worldnet5 - 13 May 2008 04:35 GMT Line 7 fails because CF does not like: .#what#.XmlText inside a ##. I tried Evaluate, DE etc, but could not get it working. Any ideas?
1<CFSET temp1 = "method, device, disposition, completed_by, who_intubated_1, who_intubated_fellow_1, cricoid_1">
2<cfset myquery = QueryNew("#temp1#")>
3<cfset temp = QueryAddRow(myquery, #NumRecords#)>
4<cfloop index="i" from = "1" to = "#NumRecords#">
5 <CFLOOP list="#temp1#" index="what">
6 <CFOUTPUT>
7 <cfset temp = QuerySetCell(myquery, "#What#", #getRecords.qdbapi.record[i].#what#.XmlText#, #i#)>
8 </CFOUTPUT>
9 </CFLOOP>
10 </CFLOOP>
Azadi - 13 May 2008 05:30 GMT try <cfset temp = QuerySetCell(myquery, "#What#", getRecords.qdbapi.record[i].#what#.XmlText, i)>
or <cfset temp = QuerySetCell(myquery, "#What#", getRecords.qdbapi.record[i]["#what#"].XmlText, i)>
or <cfset temp = QuerySetCell(myquery, "#What#", getRecords.qdbapi.record[i]["#what#"][XmlText], i)>
btw, no need for pound signs inside cf functions. thus <cfset temp = QueryAddRow(myquery, #NumRecords#)> can also be just <cfset temp = QueryAddRow(myquery, NumRecords)>
Azadi Saryev Sabai-dee.com http://www.sabai-dee.com/
worldnet5 - 13 May 2008 12:33 GMT I tried all 3 choices provided. All 3 got different errors #1:Missing argument name. #2: Element device is undefined in a Java object of type class coldfusion.xml.XmlNodeList referenced as #3: Variable XMLTEXT is undefined.
Pl help.
Adam Cameron - 13 May 2008 13:10 GMT Do you think, maybe, looking @ the docs might help?
http://livedocs.adobe.com/coldfusion/8/htmldocs/Expressions_09.htm
 Signature Adam
Adam Cameron - 13 May 2008 13:16 GMT > http://livedocs.adobe.com/coldfusion/8/htmldocs/Expressions_09.htm Make that: http://livedocs.adobe.com/coldfusion/8/htmldocs/Expressions_09.html
Bad cut and paste, sorry.
 Signature Adam
worldnet5 - 13 May 2008 20:48 GMT What nobody knows how to fix it?
Ian Skinner - 13 May 2008 21:03 GMT > What nobody knows how to fix it? Don't want to look it up and learn form the convenient links provided, eh?
http://livedocs.adobe.com/coldfusion/8/htmldocs/Expressions_09.html
Normally one would use double hash|pound symbols to escape it. But if you properly write your expressions you would not need any.
<CFSET temp1 = "method, device, disposition, completed_by, who_intubated_1, who_intubated_fellow_1, cricoid_1"> <cfset myquery = QueryNew(temp1)> <cfset temp = QueryAddRow(myquery, NumRecords)>
<cfoutput> <cfloop index="i" from = "1" to = NumRecords> <CFLOOP list=temp1 index="what"> <cfset temp = QuerySetCell(myquery, What, getRecords.qdbapi.record[i][what].XmlText, i)> </CFLOOP> </CFLOOP>
Untested code, but should be close.
Now I can chalk up another fifteen minutes of "Mentoring Junior Staff" to my State Promotion Exam.
Adam Cameron - 13 May 2008 21:08 GMT > What nobody knows how to fix it? Of course I do. *Me* knowing how to fix it is not the point of this... YOU need to know how to fix it.
And if you went and read those docs I pointed you at, you'd be able to.
I'm not simply going to give you the answer, because you'll not then understand why it's the answer. Which means the next time something similar crops up, you'll be back here, rather than knowing how to sort it out yerself.
FWIW, one of Azadi's answers is correct, and the error message is telling you something else is wrong with your code.
Read the docs, look at the error messages, and look at what one of those error messages is telling you.
 Signature Adam
Ian Skinner - 13 May 2008 21:44 GMT > I'm not simply going to give you the answer, because you'll not then > understand why it's the answer. Which means the next time something > similar crops up, you'll be back here, rather than knowing how to sort it > out yerself. Now I feel bad for amusing myself with some code clean up, since I'm in a bit of a twiddle-my-thumbs mode at the moment.
Adam Cameron - 13 May 2008 22:35 GMT > Now I feel bad for amusing myself with some code clean up, since I'm in > a bit of a twiddle-my-thumbs mode at the moment. Dude, I gotta few thousand lines of code you can tidy up if you want...
;-)
 Signature Adam
|
|
|