<CFSET AlreadyFound = False>
<CFSET CompanyList = "Limited,LTD,LTD.,Co.,Company,the ">
<cfloop query="judgement" startrow="1" endrow="1000">
        <cfset tempDefendant = #judgement.defendant#>
        <CFOUTPUT>Current Defendant is :#judgement.defendant#</CFOUTPUT>
        <br>
        <cfloop index="x" from="1" to="6">

                <!---<CFOUTPUT> The iteration is #x#</CFOUTPUT>--->
                <CFSET WordToGet=ListGetAt(#CompanyList#,#x#)>
                <!----<CFOUTPUT> The Current List Item Is:#WordToGet#</cfoutput>---->
                        <CFIF FindNoCase(#WordToGet#,#tempdefendant#) neq 0 AND NOT 
AlreadyFound>

                                <CFOUTPUT>  <font size="5" color="Red">Hey! We Found A
Company</font><br> </cfoutput>
                                <CFSET AlreadyFound =True>
                        </cfif>
        </CFLOOP>
<CFSET AlreadyFound = False>
</CFLOOP>


That's code is working just fine.

Now if someone can tell me WHY its working ..I'd like to know. Because I
just opened a new document and recoded it from scratch, and ..voila..it
works now.

I am using the same CFLOOP structure I was using before...except for this
tempdefendant thing, which does not have an effect on the inner loop.

*sigh*
I must be tired or something?

-Gel
Original 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>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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