ACF Library

find_in_array

Back to List

Description: Find an item in an ACF array

FileMaker Prototype:

Set Variable [$res; ACF_Run("find_in_array"; arraystring_arr;  string_key)]

Category: UTILITY

Function source:

function find_in_array ( array string arr, string key)
   int i; 
   for ( i = 1, sizeof(arr))
      if ( arr[i] == key) then
         return i; 
      end if
   end for
   return -1; 
end

The find_in_array Function is primarily used from other ACF functions, as FileMaker does not have an Array type. It is repetitions, but those are not compatible with our array concept.

Example

array string abc = {"a", "b", "c"}; 
int x = find_in_array(abc, "b"); 
// ==> x = 2; 
Back to List