<CFFUNCTION name="getnow">
<CFRETURN now()>
</CFFUNCTION>
<CFSET text="left of now - ##left(getnow(), 10)## - by 10 characters">
<CFOUTPUT>#evaluate('"#text#"')#</CFOUTPUT>
Basically, you set a function within a string where the function is
surrounded by pound signs. I'm using double there as it's a CFSET but if
that string was in a DB field, you would use single.
When you evaluate the string, you do a double set of quotes (single then
double or visa versa) with the variable within pound signs. This has a
multi-evaluation effect where the variable is evaluated normally, then the
string is evaluated which turns the internal variable into its value.
In this case, the value is a custom function call which can contain a query
or anything else I want. All you have to be sure of is the data being
returned.
> Ok, well you got me asking what "evaluate tricks" do you mean?
>
> Are you saying;
>
> Evaluate("this is some stuff" & importfunc() & "some more stuff")
>
> I have been experimenting with the stuff I have (the cfimport I reference
> is actually a tag replacement a former coworker wrote for forms and I
> built a wysiwyg tool to gen. a form using CFCs so marrying the 2
> together). Looks like I may be able to just use a Prefix in the cfimport
> and create calls like;
>
> <thistag:form name="#test#" action="fsda" method="post" validate="true"
> errordisplay="adfs" style="border:1px solid;background-color:##FF6699" >
>
> So got a solution (you got me thinking, thx), but interested in what you
> are saying, knowledge and all.
>
> Kevin
>
>
> >Basically, yes. There are some evaluate tricks you can use for strings
> where the
> >function is embedded in the string and the string is stored somewhere
> else like
> >a DB, but the basic concept it there. You're just wrapping the tag in a
> >different method of access.
> >
> >
> >like;
> >>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:185370
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54