Jason,

You are probably better off using structures, and have the key of the
structure be "TS200R" and then create another structure off that to store
the other information.

Then you can use StructKeyExists or StructFindKey to find your data.  The
StructFindKey function actually will search on arrays as well, so you could
also use it on your original arrays.

Thanks,

Sam

----- Original Message -----
From: "Jason Larson" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Tuesday, November 27, 2001 1:09 PM
Subject: Searching a Array


> Help I am new with array's
>
> Heres what I would like to do. I would like to search the following array
> for the value "TS200R", and return what info is associated with this
product
> item number. I have found very few examples of how to manipulate array's.
> Anybody's help would be appreciated.
>
> Thanks Jason
>
>
> *******  Begin of CF CODE   *******
>
> <!--- Setups a new Array for Collapsible Blades --->
> <cfset ColBlade= ArrayNew(2)>
>
> <!--- Product 1 --->
> <cfset ColBlade[1][1] = "TS200">
> <cfset ColBlade[1][2] = "Helium Sm Silver Alum/No Holes">
> <cfset ColBlade[1][3] = "49.99">
> <!--- Product 2 --->
> <cfset ColBlade[2][1] = "TS205">
> <cfset ColBlade[2][2] = "Helium Lg. Silver Alum/No Holes">
> <cfset ColBlade[2][3] = "55.99">
> <!--- Product 3 --->
> <cfset ColBlade[3][1] = "TS200B">
> <cfset ColBlade[3][2] = "Neon Sm. Blue Alum/No Holes">
> <cfset ColBlade[3][3] = "49.99">
> <!--- Product 4 --->
> <cfset ColBlade[4][1] = "TS205B">
> <cfset ColBlade[4][2] = "Neon Lg. Blue Alum/No Holes">
> <cfset ColBlade[4][3] = "55.99">
> <!--- Product 5 --->
> <cfset ColBlade[5][1] = "TS200R">
> <cfset ColBlade[5][2] = "Neon Sm. Red Alum/No Holes">
> <cfset ColBlade[5][3] = "49.99">
>
> *******  End of CF CODE   *******
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to