Solved

Lost among the #s

Posted on 2014-11-05
5
116 Views
Last Modified: 2014-11-11
I have a function for generating a spreadsheet and it works fine.  I use the following code to call it

<CFOUTPUT>
<CFSET K=GenerateSpreadsheet("Freddi","#GetNames#")>
#K#
</CFOUTPUT>

How do I rewrite it as

<CFOUTPUT>
#GenerateSpreadsheet("Freddi","#GetNames#")#>
</CFOUTPUT>

without the hashes around GetNames causing a problem?
0
Comment
Question by:jdthedj
  • 2
  • 2
5 Comments
 
LVL 6

Accepted Solution

by:
rjohnsonjr earned 500 total points
ID: 40425498
I wouldn't think that would throw an error but you can do this:

<CFOUTPUT>
#GenerateSpreadsheet("Freddi",GetNames)#
</CFOUTPUT>

Open in new window


I think your issue was the ending >
<CFOUTPUT>
#GenerateSpreadsheet("Freddi","#GetNames#")#>
</CFOUTPUT>

Open in new window

0
 
LVL 3

Author Closing Comment

by:jdthedj
ID: 40426875
Thanks rjohnsonjr.  I had thought I needed the hashes around the query name
0
 
LVL 52

Expert Comment

by:_agx_
ID: 40432821
>> I had thought I needed the hashes around the query name

Only because you put quotes around the variable name. When you do that, CF doesn't know GetNames is a variable. It won't evaluate it unless you put # signs around it.  So if you skip the quotes, you don't need the # signs.
0
 
LVL 3

Author Comment

by:jdthedj
ID: 40433755
Thanks for the explanation agx - It makes more sense when you understand the reasons ;-)
0
 
LVL 52

Expert Comment

by:_agx_
ID: 40434954
Yep. The real problem was the trailing ">", but I figured an explanation of the # sign stuff wouldn't hurt either :).
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The technique is by far very Simple! How we can export the ColdFusion query results to DOC file?  Well before writing this I researched a lot in Internet but did not found a good Answer anyways!  So i thought now i should share my small snippet w…
Sometimes databases have MILLIONS of records and we need a way to quickly query that table to return the results me need. Sure you could use CFQUERY but it takes too long when there are millions of records. That is why SOLR was invented. Please …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now