Thanks for all the replies. I got much more out of it than the original
question.
Much appreciated!
--Ben
--
Ben Conner[EMAIL PROTECTED]
Web World, Inc. 888-206-6486
PO Box 1122 480-704-2000
Queen Creek, AZ 85242
A little OT, but you can save some keystrokes with proper use of the '#'
symbol. Safer to lose the internal reference to the query inside the loop, too:
cfquery name=cats datasource=#Application.DSN#
snip ..
/cfquery
cfloop query=cats
cfif NOT StructKeyExists(allcats, category)
:[EMAIL PROTECTED]
Sent: Tuesday, November 11, 2008 9:02 AM
To: cf-talk
Subject: Re: inserting a structure...within a structure...within a
structure
1) Main thing is that you don't need it, because you're already in the
query 'scope' inside a CFOUTPUT or CFLOOP
2) If you do a cfoutput#cats.category
Yup, that's the case.
Adrian
-Original Message-
From: Dave Francis
Sent: 11 November 2008 14:24
To: cf-talk
Subject: RE: inserting a structure...within a structure...within a
structure
Just to clarify ... Are you saying that within a CFOUTPUT or CFLOOP, CF
changes its order
Subject: RE: inserting a structure...within a structure...within a structure
Just to clarify ... Are you saying that within a CFOUTPUT or CFLOOP, CF
changes its order of precedence and looks for query. scoped variables
first? ie. #x# will give
abc.x rather than the local variable x
@houseoffusion.com
Subject: RE: inserting a structure...within a structure...within a structure
I've never seen myQuery.myColumn inside a query loop not return what it
should. Got some sample code?
I know there was a bug a while ago (might still be with us) with nested
loops and having to set a variable
I've never seen myQuery.myColumn inside a query loop not return what it
should. Got some sample code?
Below is some sample code - it shows the problem with CF7 (haven't tested it
with anything else).
Note, as you will see, this bug(?) means that with nested queries you should
*fully* scope the
always understood it. CF does not go digging through
variables, form, url, etc first when inside a query loop.
From: Dave Francis [EMAIL PROTECTED]
Sent: Tuesday, November 11, 2008 9:24 AM
To: cf-talk cf-talk@houseoffusion.com
Subject: RE: inserting
1) Main thing is that you don't need it, because you're already in the query
'scope' inside a CFOUTPUT or CFLOOP
2) If you do a cfoutput#cats.category#/cfoutput on its own, it pulls the
first record, as though it were cats.category[1]. By putting cfoutput
query=cats#cats.category#/cfoutput
PROTECTED]
Sent: Tuesday, November 11, 2008 8:38 AM
To: cf-talk
Subject: Re: inserting a structure...within a structure...within a
structure
A little OT, but you can save some keystrokes with proper use of the '#'
symbol. Safer to lose the internal reference to the query inside the
loop, too
Why safer to lose the query ref?
Adrian
-Original Message-
From: Jason Fisher [mailto:[EMAIL PROTECTED]
Sent: 11 November 2008 13:38
To: cf-talk
Subject: Re: inserting a structure...within a structure...within a
structure
A little OT, but you can save some keystrokes with proper use
.
Adrian
-Original Message-
From: Jason Fisher
Sent: 11 November 2008 14:02
To: cf-talk
Subject: Re: inserting a structure...within a structure...within a
structure
1) Main thing is that you don't need it, because you're already in the query
'scope' inside a CFOUTPUT or CFLOOP
2) If you do
Hi Ben,
you can shorten it down a bit and go as many levels deep as you want.
Like this:
cfquery name=cats datasource=#Application.DSN#
... snip ..
/cfquery
cfloop query=cats
cfif NOT StructKeyExists(allcats, #cats.category#)
cfset allcats[#cats.category#] = StructNew()
cfset
13 matches
Mail list logo