GetIndexes ( )

Function stats

Average user rating
104
371
9999
Support
FileMaker 7.0 +
Date posted
10 November 2014
Version
1
Recursive function
Yes

Author Info
 Jeroen Aarts

3 functions

Average Rating 4.0

author_avatar



 

Function overview

Prototype

GetIndexes  ( array;   value;   start )


Parameters

array  


value  


start  


Description

Tags:  List  

Returns a list of positions of Value in array; Start = start index to search

Examples

Sample input

GetIndexes ( "a¶b¶c¶d¶e¶f¶d¶f¶d" ; "d" ; 1 )


Sample output

4¶7¶9

 

Function code

/*
Returns a list of positions of Value in array; Start = start index to search

- Jeroen Aarts, ClickWorks bvba, www.clickworks.be
*/

Let( [
firstVal = Substitute ( MiddleValues ( array ; start ; 1) ; ¶ ; "") ;
restValues = MiddleValues ( Array ; start + 1 ; ValueCount ( Array ) - (start) )
];

Case(
not ValueCount ( FilterValues ( Array ; Value ) ) or not ValueCount ( Array ) or start > ValueCount (Array) ; "" ;
firstVal = Value ; start & ¶ & GetIndexes ( Array ; Value; start + 1 );
GetIndexes ( Array ; Value ; start + 1)
)
)

// ===================================
/*

    This function is published on FileMaker Custom Functions
    to check for updates and provide feedback and bug reports
    please visit http://www.fmfunctions.com/fid/371

    Prototype: GetIndexes( array; value; start )
    Function Author: Jeroen Aarts (http://www.fmfunctions.com/mid/104)
    Last updated: 10 November 2014
    Version: 1

*/
// ===================================

 

 

 

 

 

 

 

Top Tags

Text Parsing  (33)
List  (31)
Date  (28)
XML  (26)
Format  (23)
Sql  (22)
Dev  (20)
Debug  (17)
Interface  (15)
Layout  (15)
Text  (14)
Variables  (12)
Layout Objects  (11)
Filter  (11)
Design  (10)
Array  (7)