That..uhh..doesn't help.

THe output I get is now:
Current Row is :1 The Defendant IS:MOHAMMED, ANSARI
The Current List Item Is:Limited
The Defendant IS:MOHAMMED, ANSARI
The Current List Item Is:Limited
The Defendant IS:MOHAMMED, ANSARI
The Current List Item Is:Limited
The Defendant IS:MOHAMMED, ANSARI
The Current List Item Is:Limited
The Defendant IS:MOHAMMED, ANSARI
The Current List Item Is:Limited
The Defendant IS:MOHAMMED, ANSARI
The Current List Item Is:Limited
The Defendant IS:MOHAMMED, ANSARI
The Current List Item Is:Limited
Current Row is :2 The Defendant IS:MOHAMMED, AZEEM
The Current List Item Is:Limited
The Defendant IS:MOHAMMED, AZEEM
The Current List Item Is:Limited
The Defendant IS:MOHAMMED, AZEEM

It still isn't cycling through the text list of things to find.
It is just reading the first value...but its reading it 7 times..which
suggests it is looping..but not going over the seperate values in the list.

This problem is driving me nuts!

It doesn't make sense!
The inner Index loop acts one way when its on its own, and another when I
place it within the CFQUERY loop..
To me my logic is sound..it seems to be either a CF quirk..or my syntax is
incorrect somewhere!

-Gel



-----Original Message-----
From: Kevin Gilchrist [mailto:[EMAIL PROTECTED]]

Try changing the beug code to

The ConpanyList set below doesn't need to be done for every row of the query
loop, so move it outside.

<CFSET CompanyList = "Limited,LTD,LTD.,CO,Co.,Company,&,The">

<cfloop query="judgement" startrow="1" endrow="20">

        <CFOUTPUT> Current Row is :#judgement.CurrentRow#</cfoutput>
        <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# <BR>
                                     Courrent Counter is : #Counter#
                        </cfoutput>
                        <br>
                        <CFIF Find(judgement.defendant,#Counter#) neq 0>

                                <CFOUTPUT>  Hey! We Found A Company
</cfoutput>

                        </cfif>
        </CFLOOP>
</CFLOOP>

-----Original Message-----
From: Ang�l Stewart [mailto:[EMAIL PROTECTED]]


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

Reply via email to