Thanks for the reply. So you imply that I would have to first check and make sure the element was inside the size range of the array, then I might be able to check that element for a value using one of the earlier mentioned functions.
Seems hokey, but frankly I don't put such requirement contortions beyond CF. *sigh* I'll give that a shot. Derek On Dec 7, 2009, at 11:59 AM, Paul Kukiel wrote: > > What about arrayLen? > > If someArrayIndex lte arrayLen(theArray) > Do stuff > > -----Original Message----- > From: Derek Hedstrom [mailto:[email protected]] > Sent: Monday, December 07, 2009 3:53 PM > To: cf-newbie > Subject: testing existence of array element > > > Help! > > I need to compare the value of an array element to another value, but the > array element may not always exist. How can I check for this? > > I have tried ArrayIsDefined(), and IsDefined(). > > ArrayIsDefined() gives me the following error: > <cfoutput>#ArrayIsDefined(arSelected,3)#</cfoutput> > Cannot access array element at position 3. > The array has 2 indexes. Valid positions are from 1 to 2. > > Yeah, duh! That's what I am trying to find out! > > IsDefined doesn't seem to like array notation: > <cfoutput>#IsDefined("arSelected[1]")#</cfoutput> > Parameter 1 of function IsDefined, which is now arSelected[1], must be a > syntactically valid variable name. > > TIA, > Derek > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:4916 Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15
