On 11/8/05, Geoff Parkhurst <[EMAIL PROTECTED]> wrote:
> Should you be doing:
>
> <cfset instanceQuery=Instance.returnQuery() />
>
> <cfoutput query="variables.instanceQuery">
>         #variables.instanceQuery.column1#
> </cfoutput>

It depends. If you are inside a CFC, you probably want to do this instead:

<cfset var instanceQuery = instance.returnQuery() />

<cfoutput query="instanceQuery">
        #instanceQuery.column1#
</cfoutput>

(of course, I'd question why you would be generating HTML output
inside a CFC at that point!)

> Or even <cfset variables.instanceQuery=Instance.returnQuery() />

Again, inside a CFC you'd need to be explicit about local vs variables
(protected instance) scope. In a CFM page, you could omit the
"variables." prefix but a number of people think it's best practice to
be explicit about it.
--
Sean A Corfield -- http://corfield.org/
Got frameworks?

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to 
[email protected] with the words 'unsubscribe cfcdev' as the subject of the 
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
(www.cfxhosting.com).

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


Reply via email to