• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

# within a #

Guest
May 12, 2008 May 12, 2008

Copy link to clipboard

Copied

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?
TOPICS
Advanced techniques

Views

460

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 12, 2008 May 12, 2008

Copy link to clipboard

Copied

try
<cfset temp = QuerySetCell(myquery, "#What#",
getRecords.qdbapi.record .#what#.XmlText, i)>

or
<cfset temp = QuerySetCell(myquery, "#What#",
getRecords.qdbapi.record
["#what#"].XmlText, i)>

or
<cfset temp = QuerySetCell(myquery, "#What#",
getRecords.qdbapi.record ["#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/

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 13, 2008 May 13, 2008

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 13, 2008 May 13, 2008

Copy link to clipboard

Copied

Do you think, maybe, looking @ the docs might help?

http://livedocs.adobe.com/coldfusion/8/htmldocs/Expressions_09.htm

--
Adam

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 13, 2008 May 13, 2008

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 13, 2008 May 13, 2008

Copy link to clipboard

Copied

What nobody knows how to fix it?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 13, 2008 May 13, 2008

Copy link to clipboard

Copied

worldnet5 wrote:
> 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 [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.


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 13, 2008 May 13, 2008

Copy link to clipboard

Copied

> 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.

--
Adam

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 13, 2008 May 13, 2008

Copy link to clipboard

Copied

Adam Cameron wrote:
> 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.


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 13, 2008 May 13, 2008

Copy link to clipboard

Copied

LATEST
> 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...

;-)

--
Adam

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation