Try this:

<cfset a="apple">
<cfset b="banana">
<cfset c="cumquat">
<cfset st = "##a## ##b## ##c##">

<cfoutput>#st# -> #evaluate(de(st))#</cfoutput>

Note that you may be opening up a potential security hazard. Users could
display any variable in your app. If you wanted to avoid this, you could
parse the text manually: listreplace("##VAR1##,##VAR2##...",
"#VAR1#,#VAR2#,...")  -- of course using comma as a delimiter would probably
be a mistake there.

----- Original Message -----
From: "Steven Monaghan" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Thursday, October 10, 2002 6:53 AM
Subject: Getting CF to display value, not variable


> For the app I am working on, the "power users" are given a maintenance
> screen.  From this screen, they can build a free-form description. But,
they
> need to be able to include dynamic data in the description.
>
> They are entering variable names in the description wrapped in # signs.
> But, I cannot figure out how to get CF to realize that the data inside the
> variable needs to be evaluated as well as the data itself.
>
> I tried using the Evaluate function, but it blew up when it hit the #
sign.
>
> Sorry if this is a simple question, but I only get to do CF part time, and
> appreciate any help.
>
> Thanks,
> Steve
>
> -------------------------------------
> Steven Monaghan
> Oracle DBA / Cold Fusion Developer
> MSC Industrial Direct Co., Inc.
> http://www.mscdirect.com
> -------------------------------------
>
>
> This e-mail is intended for the use of the addressee(s) only and may
contain
> privileged, confidential, or proprietary information that is exempt from
> disclosure under law.  If you are not the intended recipient, please do
not
> read, copy, use or disclose the contents of this communication to others.
> Please notify the sender that you have received this e-mail in error by
> replying to the e-mail.  Please then delete the e-mail and destroy any
> copies of it.  Thank you.
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Reply via email to