ValueListIndex ( )

Function stats

Average user rating
532
402
9999
Support
FileMaker 7.0 +
Date posted
03 September 2016
Version
1
Recursive function
No

Author Info
 David Moyer

6 functions

Average Rating None

author_avatar



 

Function overview

Prototype

ValueListIndex  ( valueList;   valueToFind )


Parameters

valueList  the list to evaluate


valueToFind  the value you wish to find the row # of


Description

Tags:  value lists  

Given a ¶-delimited list, and a value that exists within the list (on it's own line), this function returns the row number of that value. The values can contain multiple words.

Examples

Sample input

ValueListIndex ( List ( "red"; "green"; "blue") ; "green" )


Sample output

2

 

Function code

Let(
[
padList = "¶" & valueList & "¶";
padValue = "¶" & valueToFind & "¶";
start = Position(padList; padValue; 1; 1)
];
PatternCount(Left(padList; start); "¶")
)

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

    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/402

    Prototype: ValueListIndex( valueList; valueToFind )
    Function Author: David Moyer (http://www.fmfunctions.com/mid/532)
    Last updated: 03 September 2016
    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)