Hi Christian,

>> Also, are there any other questions in this thread left unanswered?

I would really like to see all of the native cf tags that return structs
(cfhttp, cfftp, cffile, cfquery etc..) put down in a grid with an
explanation for how each one behaves in this context.  cfquery's
executionTime might be something used rarely enough that it doesn't seem
like a big deal, but the implications of it's behavior are a bit
frightening.

Could you (or one of your macromedia friends) put something like that
together?

 - j.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Christian Cantrell
Sent: Friday, February 13, 2004 6:54 AM
To: [EMAIL PROTECTED]
Subject: Re: [CFCDev] How should I define variable in a CFC?


It's just as we all suspected.  You should indeed scope things like
query variables, like this...

<cffunction name="myFunction"...>
����� <cfset var q = ""/>
����� <cfquery name="q">
����������� SELECT * FROM Users
����� </cfquery>
����� <cfreturn q/>
</cffunction>

... and the "cfquery" struct is stored in the variables scope, which is
why this works:

<cffunction name="myFunction"...>
����� <cfset var q = ""/>
����� <cfquery name="q">
����������� SELECT * FROM Users
����� </cfquery>
����� <cfset reportExecutionTime()/>
����� <cfreturn q/>
</cffunction>

<cffunction name="reportExecutionTime">
����� <cflog text="#cfquery.executionTime#"/>
</cffunction>

There does not appear to be a way to scope the "cfquery" struct just to
the myFunction function.  Is this something people feel they need?  I
personally have never had an issue with behavior, but if others have,
we can see about getting it changed.

Also, are there any other questions in this thread left unanswered?

Christian
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at
www.mail-archive.com/[EMAIL PROTECTED]


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to