When you loop through a list of words, your "counter" isn't a number .. it's
the current word you are on in the list.  Therefore, the first time through,
"counter" is "Limited" .. the second time through, it is LTD.  When you use
"counter" as a number in ListGetAt(#CompanyList#,#counter#,",")>, I imagine
CF is getting confused and just picking the first thing it finds in the
list.

Try just <cfoutput>ting your "counter" there instead of using ListGetAt() ..
or find the position of your "counter" in your list with ListFind() or
ListFindNoCase() and use that in your ListGetAt()

Todd Ashworth --
Web Application Developer
Network Administrator

Saber Corporation
314 Oakland Ave.
Rock Hill, SC 29730
(803) 327-0137 [111]
----- Original Message -----
From: "Angél Stewart" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Wednesday, March 21, 2001 2:42 PM
Subject: RE: Need assistance:Nested CFLOOPs


| umm..judgement.defendant is changing..thats not the problem.
|
| The problem is that it is not going over the list of words to search for.
| The list called Company List.
|
| So hence you see Limited,Limited,Limited Limited 7 times in the output.
|
| When what you should see is
|
| The Defendant IS:MOHD, SARI
| The Current List Item Is:Limited
| The Defendant IS:MOHD, SARI
| The Current List Item Is:Ltd
| The Defendant IS:MOHD, SARI
| The Current List Item Is:Ltd.
| The Defendant IS:MOHD, SARI
| The Current List Item Is:CO
| The Defendant IS:MOHD, SARI
| The Current List Item Is:CO.
| The Defendant IS:MOHD, SARI
| The Current List Item Is:THE
|
| etc. etc.
| But it is just picking up that first list item, Limited..and although it
is
| going over the thing 7 times..its not reading the other items in the list.
|
| I know there is some simple syntax error somewhere..I just can't find it.
|
| -Gel
|
|
|
| -----Original Message-----
| From: Phoeun Pha [mailto:[EMAIL PROTECTED]]
| Sent: Wednesday, 21 March 2001 12:59
| To: CF-Talk
| Subject: RE: Need assistance:Nested CFLOOPs
|
|
| I just skimmed through it, and it seemed that your query output is not
| right.
|
| When u do a judgement.defendant inside that query loop, it will always
| remain the same.  it will always output the first row from that query.
| instead, just use defendant.  since you're already inside that query loop,
| it will refer to the query name.  there is no need to specify it
|
|
|
|
| -----Original Message-----
| From: Angél Stewart [mailto:[EMAIL PROTECTED]]
| Sent: Wednesday, March 21, 2001 9:39 AM
| To: CF-Talk
| Subject: Need assistance:Nested CFLOOPs
|
|
| Hi all.
|
| I am having a problem with a nested CFLOOP refusing to loop!
|
| The Code:
| <cfloop query="judgement" startrow="1" endrow="20">
| <CFSET CompanyList = "Limited,LTD,LTD.,CO,Co.,Company,&,The">
| <cfloop index="counter" list="#CompanyList#" delimiters=",">
| <CFOUTPUT> The Defendant
| IS:#judgement.defendant#</cfoutput>
| <br>
| <CFSET
| WordToGet=ListGetAt(#CompanyList#,#counter#,",")>
| <CFOUTPUT> The Current List Item
| Is:#WordToGet#</cfoutput>
| <br>
| <CFIF Find(judgement.defendant,#Counter#) neq 0>
|
| <CFOUTPUT>  Hey! We Found A Company
| </cfoutput>
|
| </cfif>
| </CFLOOP>
| </CFLOOP>
|
| I want to search the defendant field to determine if any of those strings
| are contained within it.
| It cycled fine, until I enclosed it in the CFLOOP query="judgement"...
|
| I expected it to go to the first record in teh Judgement table..
|
| Then loop through the strings to search for, perform the search...and then
| drop out and CFQUERY LOOP back to the top..wher eit would go to the next
| record...and do the same thing.
|
| What's the problem with my code?
|
| This is my output:
|
| The Defendant IS:MOHD, SARI
| The Current List Item Is:Limited
| The Defendant IS:MOHD, SARI
| The Current List Item Is:Limited
| The Defendant IS:MOHD, SARI
| The Current List Item Is:Limited
| The Defendant IS:MOHD, ANSARI
| The Current List Item Is:Limited
| The Defendant IS:MOHD, SARI
| The Current List Item Is:Limited
| The Defendant IS:MOHD, SARI
| The Current List Item Is:Limited
| The Defendant IS:MOHD, SARI
| The Current List Item Is:Limited
| The Defendant IS:MOHD, SARI
|
| So it is clearly not cycling through the list of strings to search for.
|
| -Gel
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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

Reply via email to