Link to home
Start Free TrialLog in
Avatar of APS NZ
APS NZFlag for New Zealand

asked on

Lost among the #s

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?
ASKER CERTIFIED SOLUTION
Avatar of Randy Johnson
Randy Johnson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of APS NZ

ASKER

Thanks rjohnsonjr.  I had thought I needed the hashes around the query name
Avatar of _agx_
>> 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.
Avatar of APS NZ

ASKER

Thanks for the explanation agx - It makes more sense when you understand the reasons ;-)
Yep. The real problem was the trailing ">", but I figured an explanation of the # sign stuff wouldn't hurt either :).