?
Solved

Lost among the #s

Posted on 2014-11-05
5
Medium Priority
?
125 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 6

Accepted Solution

by:
rjohnsonjr earned 2000 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

Cloud Training Guides

FREE GUIDES: In-depth and hand-crafted Linux, AWS, OpenStack, DevOps, Azure, and Cloud training guides created by Linux Academy instructors and the community.

Question has a verified solution.

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

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 …
This is an updated version of a post made on my blog over 3 years ago. It is unfortunately, still very relevant as we continue to see both SQLi (SQL injection) and XSS (cross site scripting) attacks hitting some of the most recognizable website and …
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

770 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