oh u snifflebutt.  eh heh

u used the listloop wrong!  when u use a listloop, u wont need a listgetat
function.  it automatically does it for ya!  so it should be like this.  i
also modified the code to make it work with the new code. :P

<cfloop query="judgement" startrow="1" endrow="20">
        <CFSET CompanyList = "Limited,LTD,LTD.,CO,Co.,Company,&,The">
<CFSET counter = 0>
        <cfloop index="THETHINGYLISTHEHE" list="#CompanyList#"
delimiters=",">
<CFSET counter=counter+1>
                        <CFOUTPUT> The Defendant
IS:#judgement.defendant#</cfoutput>
                        <br>
                        <CFOUTPUT> The Current List Item
Is:#THETHINGYLISTHEHE#</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]]
Sent: Wednesday, March 21, 2001 1:42 PM
To: CF-Talk
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/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to