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/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists