<[EMAIL PROTECTED]> wrote in message news:21892@cfaussie...
[...]
> Yes, I've seen this somewhere in the docs, and been using it for a while.
> But the cool thing about being able to use the var keyword with <cfset> is
> that now I could go around and implement every single CF tag as an
> user-defined function without having to worry about overwriting variables.
>
> So no more hopping in and out of <cfscript> for things like <cfquery>,
> <cffile>, etc. Hooray...
>
> Anyone thought of / interested in doing something like that?
Been there, doing that*! It's one of the more wicked features of CFMX. I
absolutely love the components, and am learning more every day. I have a
"util" component that I use to encapsulate all the CFML tags I want to use
on an as-needed basis, it works great. It's just a copy and paste between
projects too, so I'm building a nice to use code library without having to
sweat it too much.
Another thing the functions lend themselves to is the following scenario of
logical evaluations, where you can move chunks of code in your case
controller outside, so as to make the whole thing a lot cleaner and easier
to maintain - plus it's way easier to reuse whatever chunks you might want
to reuse.
---------------------------------------------------------------------------
<cfscript>
switch (something) {
case "this": {
// insert evaluation logic here
}
case "that": {
renderlotsofHTML();
}
</cfscript>
<cffunction name="renderlotsofhtml" hint="it's easier than escaping all
those characters in a writeoutput() anyway">
<cfoutput>
"This is lots of html"
</cfoutput>
</cffunction>
---------------------------------------------------------------------------
Well, maybe not that exciting; just something I did over the weekend
anyway.. :)
Cheers,
J�rgen
*) see comments on
http://livedocs.macromedia.com/cfmxdocs/Developing_ColdFusion_MX_Application
s_with_CFML/CFScript3.jsp
---
You are currently subscribed to cfaussie as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]
MX Downunder AsiaPac DevCon - http://mxdu.com/