House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

Checking arrays for any values

  << Previous Post |  RSS |  Tree View |  Sort Oldest First |  Subscribe to this Group Next >> 

Checking arrays for any values

In CF9, Adobe have (finally) added the ArrayFind function, which simplifies that Peter Boughton 09/06/2010 07:07 AM
You can do listFind(arrayToList(aYourArray),1)  for the bit datatypes. Scott Brady 09/06/2010 06:38 AM
It's not clear what you're trying to do. Peter Boughton 09/06/2010 05:36 AM
If any of the elements of an array have a value of 1 for bit datatypes or don't Richard Steele 09/05/2010 10:26 PM
If any of the elements of an array have a value of 1 for bit datatypes or if all Richard Steele 09/05/2010 10:26 PM

09/06/2010 07:07 AM
Author: Peter Boughton Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:61887#336835 In CF9, Adobe have (finally) added the ArrayFind function, which simplifies that code. (Also available in OpenBD v1.3 and above, and in Railo since early days.)
09/06/2010 06:38 AM
Author: Scott Brady Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:61887#336833 You can do listFind(arrayToList(aYourArray),1)  for the bit datatypes.  I'm not sure what the performance of that will be if your array is very large, though. For the string array, you can do NOT listFind(arrayToList(aYourArray,"")) I'm not sure if that logic is exactly correct, but it should get you going down the right path. Scott ----- Excess quoted text cut - see Original Post for more ----- -- ----------------------------------------- Scott Brady http://www.scottbrady.net/
09/06/2010 05:36 AM
Author: Peter Boughton Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:61887#336832 It's not clear what you're trying to do. Can you post examples of each type of value it might contain, and whether that is considered true/false? (It's probably still simplest to step through the array and check each value though.)
09/05/2010 10:26 PM
Author: Richard Steele Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:61887#336830 If any of the elements of an array have a value of 1 for bit datatypes or don't have empty strings for string datatypes, then I need to have my program do one thing, otherwise, if everything is either empty or false, another thing.  I could parse the array and get their values, but I wonder if there is an easier way. Thanks in advance.
09/05/2010 10:26 PM
Author: Richard Steele Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:61887#336831 If any of the elements of an array have a value of 1 for bit datatypes or if all string datatypes are empty, then I need to have my program do one thing, otherwise, if everything is either empty or false, another thing.  I could parse the array and get their values, but I wonder if there is an easier way. Thanks in advance.
<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

May 24, 2012

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
     1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31     

Designer, Developer and mobile workflow conference