That's a good point Robert - but I must admit the only time I don't scope a
variable is when I cfoutput it in a query. So I would just reference the
column name. I know, I know, I'm being a bad boy - ok fine I'll stand in the
corner for 30 mins... Happy? No... What else do you want from me!
Actually, what if CF created a temporary local scope for you within the
cfoutput. That would be cool.
So this would work:
<cfoutput query="Instance.returnQuery()">
#instanceQuery.column1#
</cfoutput>
Cheers,
Baz
---------------------------------------------
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Robert Blackburn
Sent: Tuesday, November 08, 2005 9:32 AM
To: [email protected]
Subject: Re: [CFCDev] CFOUTPUT Query returned from CFC
If you used a method like that, how would you expect to go about
referring to the query inside the output/loop?
For example:
<cfset instanceQuery= Instance.returnQuery() />
<cfoutput query="instanceQuery">
#instanceQuery.column1#
</cfoutput>
But if I did this:
<cfoutput query="Instance.returnQuery()">
...
</cfoutput>
Sense I don't have a reference to the query itself inside the output,
how would I output the query's information?
-------
Rob Blackburn
http://www.rbdev.net
On 11/8/05, Patrick McElhaney <[EMAIL PROTECTED]> wrote:
> That's correct, Baz. The value of the query attribute is the name of a
> variable, not an expression. Drives me crazy.
>
> Patrick
>
>
> On 11/8/05, Baz <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> >
> >
> > If a method returns a query, you can't just do this can you:
> >
> >
> >
> > <cfoutput query="Instance.returnQuery()">
> >
> >
> >
> > You have to do it in 2 steps:
> >
> >
> >
> > <cfset instanceQuery= Instance.returnQuery() />
> >
> > <cfoutput query="instanceQuery">
> >
> >
> >
> > Right?
> >
> >
> >
>
>
> --
> Patrick McElhaney
> 704.560.9117
> http://pmcelhaney.weblogs.us
>
>
> ----------------------------------------------------------
> 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]
>
>
>
----------------------------------------------------------
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]
----------------------------------------------------------
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]