On Sun, Aug 31, 2008 at 10:09 PM, Gerald Guido wrote:
>>>Use cfinvoke.
>
> Thanx James
>
> I thought about that, and you are right. But I was hoping to keep it in a
> cfscript block.
>
> Is there a way to do that? This is more of an academic pursuit than a
> practical one btw. Just digging in and seeing what I can do more than
> anything else.

Heh.  Building CF and executing it with evaluate is pretty fun, you
can do some not-often seen things that way...

Another way is using [insert whatever it is called here], like with javascript.

I'm not sure about your exact problem, sorta calling components
dynamically, but you can do stuff with functions, that might lead you
towards the knowledge you seek.

Here's an excerpt from something I was just playing with a while ago:
http://tools.assembla.com/svn/denny/cfparser/den/cfparser/ui/cfparserui.cfc

        <cffunction name="runmethod" output="false">
                <cfargument name="methodname" default="main" />
                        <cfset var funk = "" />
                        <cftry>
                          <cfset funk = this[methodname] />
                          <cfreturn funk() />
                          <cfcatch>
                                  <cfdump var="#cfcatch#">
                                  <cfabort />
                          </cfcatch>
                        </cftry>
        </cffunction>

Basically as sort of a controller type deal.  With the direct
assignment of objects and functions as variables (or some type of
language like that), you can dynamically call stuff.

I think this is, probably, NOT very nice, "pattern" wise (too flexible
;-]), so if you're trying to get away from evaluate... dunno if
getting similarly loc (in a different way) is the best idea.

It's good for getting the job done, but as you can see from the above,
it can get messy pretty fast, if you don't keep it in line (things
that would make my example better would be checking metadata for the
function's existence and whatnot, for instance... stuff to at least
make debugging easy and whathaveyou, I guess... I'm horrible, because
I already know where to look... someone else wouldn't. --  And me 5
years later might not either, right?  right.).
It should be easy to trace what's happening, basically, and stuff
that's *too* dynamic can be *too* hard to diagnose.

It's fun stuff tho, and like all things, used right... can be just
dandy.  I reckon.

Hope it helps.  Sorry if it's not too helpful, I am sorta buzzed.

-- 
The study of law left me unsatisfied, because I did not know the
aspects of life which it serves. I perceived only the intricate mental
juggling with fictions that did not interest me.
Karl Jaspers

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:311865
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to