Re: 'nother loop problem

2001-03-24 Thread Jim McAtee

You can treat each column (field) as a one dimensional array, as in

prerequisite.somefield[1]
prerequisite.anotherfield[1]

Be careful nesting loops in CF... if you try looping over one query inside a
loop over another query, you may get some unexpected behavior.  Using
indexes in the inner loop may actually overcome the problem.

Jim


- Original Message -
From: "megan sherman" [EMAIL PROTECTED]
To: "CF-Talk" [EMAIL PROTECTED]
Sent: Saturday, March 24, 2001 2:19 PM
Subject: 'nother loop problem


 Hi all,
 Thanks for the previous help on loops. Now I have a new problem. I want
 to compare the results of one record set to those of another. I would
 like to refer to each record in one of the record sets by using the
 index of the loop. Is there an object naming convention in Cold Fusion
 where each record is named? For example, if my query is named
 "prerequisite", you can get the total number of records by referring to
 prerequisite.recordcount. Can you refer to each individual record in
 that record set with something like prerequisite.record.1,
 prerequisite.record.2, and so on? If I could refer to each record this
 way (sort of like an array?) then I could use something like
 #evaluate("prerequisite.record."#x#)# to achieve my goal.
 Thanks for any help you can offer,
 Megan


 Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
 Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists


~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: 'nother loop problem

2001-03-24 Thread Bob Silverberg

You can refer to your results as queryname.column[index].

For example, if you had a query called qryMyStuff, and it contained two
columns, MyId and MyName, you could refer to the contents of the name column
of the first record as qryMyStuff.MyName[1].

Bob

-Original Message-
From: megan sherman [mailto:[EMAIL PROTECTED]]
Sent: Saturday, March 24, 2001 4:19 PM
To: CF-Talk
Subject: 'nother loop problem


Hi all,
Thanks for the previous help on loops. Now I have a new problem. I want
to compare the results of one record set to those of another. I would
like to refer to each record in one of the record sets by using the
index of the loop. Is there an object naming convention in Cold Fusion
where each record is named? For example, if my query is named
"prerequisite", you can get the total number of records by referring to
prerequisite.recordcount. Can you refer to each individual record in
that record set with something like prerequisite.record.1,
prerequisite.record.2, and so on? If I could refer to each record this
way (sort of like an array?) then I could use something like
#evaluate("prerequisite.record."#x#)# to achieve my goal.
Thanks for any help you can offer,
Megan


Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists


~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists