>- see footer for list info -<
>When you output the file path you would just replace the place holder
with the appropriate variable. eg.
>replace(path,"[root]",request.root,"all")
>You can probably do some clever bit of regex

Why would you do all that instead of just using evaluate()?  It seems
you're making a rod for your own back there.

The usual argument against using evaluate() is that it's dead slow - it
is - but that just means don't use it in situations where it's not the
best tool for the job:

<cfset "dynamicVar#i#" = "foo">
<cfoutput>#evaluate("dynamicVar#i#")#</cfoutput>

MOST of the time I see evaluate() in use, it's the above sort of
example, which is... NOT the right time to be using it (instead do
this):

<cfoutput>#variables["dynamicVar#i#"]#</cfoutput>

Given the above, people often get it into their heads that "evaluate()
is bad in that situation" to "evaluate() is bad in ALL situations".  Not
so.

There are a (/very) few situations in which evaluate() is the tool for
the job.  And runtime substitution of dynamic values is exactly the
right time.

As slow as it is, evaluate(de()) is going to be FASTER - not to mention
CLEARER - than doing a series of replace() statements to replace a bunch
of dynamic values in a string.

-- 
Adam
_______________________________________________

For details on ALL mailing lists and for joining or leaving lists, go to 
http://list.cfdeveloper.co.uk/mailman/listinfo

--
CFDeveloper Sponsors:-
>- Hosting provided by www.cfmxhosting.co.uk -<
>- Forum provided by www.fusetalk.com -<
>- DHTML Menus provided by www.APYCOM.com -<
>- Lists hosted by www.Gradwell.com -<
>- CFdeveloper is run by Russ Michaels, feel free to volunteer your help -<

Reply via email to