Solved

Lost among the #s

Posted on 2014-11-05
5
114 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
Comment Utility
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
Comment Utility
Thanks rjohnsonjr.  I had thought I needed the hashes around the query name
0
 
LVL 52

Expert Comment

by:_agx_
Comment Utility
>> 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
Comment Utility
Thanks for the explanation agx - It makes more sense when you understand the reasons ;-)
0
 
LVL 52

Expert Comment

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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Hi, I will be creating today a basic tutorial on how we can create a Mail Custom Function and use it where ever we want. The main advantage about creating a custom function is that we can accommodate a range of arguments to pass to the Function and …
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 …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

772 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

10 Experts available now in Live!

Get 1:1 Help Now