This whole thread is getting a little off the orginal question, which was,
sort of, what's the best way set 'constant' variables, such as DSNs, company
names, etc., when setting them in the Application.cfm file?  Is it <cfset>
or <cfparam>?  Judging by the responses, I would assume that <cfset> is
faster, but it seams awkward to <cfset> the same variable with the same
value for every single page that is loaded.  Is there a better way to set
such variables other than sticking them in the Application.cfm?  This is
purely academic, so there is no such thing as getting too deep ;)

Todd Ashworth

> >
> > Any idea which is faster?
> >
> CFSET is faster of course, but i think that you'll find that cfparam is
> faster than :
>
> <cfif NOT Isdefined("scope.variablename")>
> <cfset scope.variablename = something>
> </cfif>
>
> > > The flags
> > > could be stored in a fast access location rather than a variable look
> > up/variable verification in memory somewhere.
> >
> > Such as?
> >
> I think you're getting in too deep to something that you really don't need
> to worry about too much.
>
> Here is a quick run down of ways you can set variables in CF:
>
> <CFSET variable = something> is a straight create/overwrite
> <CFPARAM name="variable" default="something"> will only set the variable
if
> it isn't already created (this is quicker than the above IsDefined if
> statement above.
>
> <CFSCRIPT>
>    variable = something;
> </cfscript>
>
> is apparently (never tested it myself) quicker than doing a CFSET if you
are
> handling a lot of variables or if you're used to VB or JS.
>
> However, in application.cfm you should only really be setting application,
> session or client variables.  Do you really want to be overwriting an
> application variable when someone else may be trying to read that
variable?
>
>
> Regards
>
> Stephen


------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to