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
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
cleaner and a wee bit safer to skip it since you're already
in scope.
Why safer to lose the query ref?
Adrian
structure
~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
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
#,
#thesubcat#)
/cfif
/cfloop
I need to add a 3rd structure level to this, so for each subsection
there will be 0 or more structures within each subsection.
Would this be reasonable:
cfquery name=cats datasource=#Application.DSN#
SELECT a.categoryname as category, a.categoryid as acategoryid
#], #subsection#)
cfset thesubcat=StructNew()
cfset thesubcat.created=0
cfset thesubcat.catid=#categoryid#
cfset tmp=StructInsert(allcats[#category#], #subsection#,
#thesubcat#)
/cfif
/cfloop
I need to add a 3rd structure level to this, so for each subsection
Can I do a structure in a structure? For example, I have a Customer that
can contain a Company and one for more buying and billing people:
Module defCustomer.cfm:
cfscript
attributes.Customer.Key=0;
attributes.Customer.IsCompany = False;
attributes.Customer.IsDeleted = False
Company
Write People
IF OK, Commit, otherwise rollback
Display results
What are your recommendations?
Andy
-Original Message-
From: Dwayne Cole [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 10, 2003 3:22 AM
To: CF-Talk
Subject: Re: Structure
people, customers and companies are
related. If a customer has a person, and a company has a person, why
would a customer have a company?
You can place one structure within another, also.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
Can I do a structure in a structure? For example, I have a Customer that
can contain a Company and one for more buying and billing people:
Module defCustomer.cfm:
cfscript
attributes.Customer.Key=0;
attributes.Customer.IsCompany = False;
attributes.Customer.IsDeleted = False
18 matches
Mail list logo