Instead of nested loops, use a struct for the found values:

found[value] = true;

then you can just test if a value exists with structKeyExists(found,value).

That way you only have to loop over the form (one loop).

Sean

On Thu, Oct 14, 2010 at 1:23 PM, Michael Grant <mgr...@modus.bz> wrote:
>
> 1. create an array to hold "found" values.
> 2. loop through form.fieldnames
> 3. for each form field loop through array of found values. if value found
> inside found values array throw exception, if not add it to the array.
> 4. if you make it to the end of the fieldnames loop you haven't found a
> duplicate.
> 5. profit. (should be step 3)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:338216
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to