list.find ( )

Function stats

Average user rating
29
121
9999
Support
FileMaker 7.0 +
Date posted
07 December 2008
Last updated
09 December 2008
Version
1
Recursive function
No

Author Info
 Genx

18 functions

Average Rating 4.1

author_avatar



 

Function overview

Prototype

list.find  ( listValues;   string )


Parameters

listValues  The list of values in which to search for the string


string  The string to search for


Description

Tags:  List   Find  

Finds the index of a given string within a list. If the item is not found within the list, the function will return 0 instead.

Examples

Sample input

list.find("test1¶test2¶test3¶test4"; "test3" )


Sample output

3

 

Function code

Let( itemPos = Position( ¶ & listValues & ¶ ; ¶ & string & ¶ ; 0 ; 1 );
    If( not itemPos ; 0 ; PatternCount ( Left( listValues ; itemPos - 1 ) ; ¶ ) + 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/121

    Prototype: list.find( listValues; string )
    Function Author: Genx (http://www.fmfunctions.com/mid/29)
    Last updated: 09 December 2008
    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)